tfTeldUserSend
Table of Contents >> Application Reference >> Telnet Daemon
| #include <trsocket.h> |
| int tfTeldUserSend | ( |
| ttUserTeldHandle teldHandle, | |
| char * teldSendBufPtr, | |
| int teldBytes, | |
| int flag | |
| ); |
Function Description
This function is called to give data to the TELNET server to send it to the TELNET client.
Flag Values
If the 'flag' value is TM_TELD_SEND_EOL, it indicates that end of command has been reached and means that the telnet server needs to append <CR, LF> in ASCII mode, or <IAC, EOR> in binary mode to the user data. If the 'flag' value is TM_TELD_SEND_COMMAND, it indicates that the user is sending a TELNET IAC command, and that the Treck TELNET server should treat the data as a command, and not map the IAC character.
Flow Control
If the Treck server does not have enough room for the data, it will not copy the data and return TM_EWOULBLOCK. The caller should try and re-send the data at a later time.
Parameters
- teldHandle
- Unique identifier for a TELNET connection.
- teldSendBufPtr
- A pointer to the user send buffer containing the data.
- teldBytes
- The number of bytes in 'teldSendBufPtr' to be sent.
- flag
- One of the following:
- TM_TELD_SEND_EOL: indicates that an EOL should be sent.
- TM_TELD_SEND_COMMAND: indicates that the user is sending a TELNET IAC command instead of data.
- TM_TELD_SEND_DONT_FLUSH: instruct the telnet server to buffer the user data instead of sending it immediately. This flag should only be used if the user expects to send more data.
Returns
- TM_ENOERROR
- Success.
- TM_ENOBUFS
- Failed to allocate a buffer to copy the send data into.
- TM_EINVAL
- Invalid Telnet Handle.
- TM_EWOULDBLOCK
- User did not have enough room for all the data.