2 #include "TelnetCommand.hpp"
5 static char IAC
[] = { 255, 0 };
7 TelnetCommand::TelnetCommand( const TelnetWPtr
& parent
)
13 TelnetCommand::~TelnetCommand()
17 void TelnetCommand::Reset()
19 memset( m_buf
, 0, sizeof( m_buf
) );
23 bool TelnetCommand::Parse( unsigned char byte
)
30 m_buf
[m_byte
++] = byte
;
32 TelnetPtr parent
= m_parent
.lock();
44 else if( m_byte
== 2 )
50 case 242: // Data Mark
52 case 244: // Interrup Process
53 case 245: // Abort output
58 case 246: // Are You There
59 parent
->Write( "HELLO" );
63 case 247: // Erase character
64 parent
->EraseCharacter();
68 case 248: // Erase Line
90 char tmp
[] = { 255, 0, m_buf
[2], 0 };
95 tmp
[1] = 254; // DON'T
104 tmp
[1] = 252; // WON'T
105 parent
->Write( tmp
);