Ejemplo n.º 1
0
//telnet handler functions
void Socket::OnOption(EventArgs* args)
{
    OptionEventArgs* eargs = (OptionEventArgs*)args;
    unsigned char option = eargs->GetOption();
    unsigned char command = eargs->GetCommand();
//mccp2
    if (command == TELNET_WILL && option == TELNET_COMPRESS2)
        {
            Write(TELNET_COMPRESS2_STR);
            Flush();
            if (!InitCompression())
                {
                    Kill();
                }
            return;
        }
//termtype
    if (command == TELNET_WILL && option == TELNET_TERMTYPE)
        {
            Write(TELNET_REQUEST_TERMTYPE);
            return;
        }

    return;
}
Ejemplo n.º 2
0
//telnet handler functions
void Socket::OnOption(char option, char command)
{
//mccp2
    if (option == TELNET_WILL && command == TELNET_COMPRESS2)
        {
            if (!InitCompression())
                {
                    Kill();
                }
            Write(TELNET_COMPRESS2_STR);
            Flush();
            _compressing = true;
            return;
        }

//termtype
    if (option == TELNET_WILL && command == TELNET_TERMTYPE)
        {
            Write(TELNET_REQUEST_TERMTYPE);
            return;
        }

    return;
}