Home |
Function cb_telnet_inchar_fnc |
Function cb_telnet_inchar_fncApplication callback to process characters received from a Telnet client. typedef struct _telnet_context { int tns_socket; int tns_options[7]; char tns_buf[80]; int tns_bp; } telnet_context; int cb_telnet_inchar_fnc(struct _telnet_context * pcontext, BYTE c); ParameterspcontextPointer to the context structure of the current session. cCharacter received. return valueReturns 0 if successful, otherwise SOCKET_ERROR. Return SOCKET_ERROR to terminate/disconnect the session. This callback is called by the Telnet Server each time a character has been received. The application can use it to parse incoming commands and to send data back to the client. Usually, character c should be echoed back to the client. pcontext->tns_socket can be used to send data to the client. pcontext->tns_bp and pcontext->tns_buf are free for application use; for example, to maintain state information of the current session. Please refer to demo program Telnets for a complete example.
|