tfTeldUserSetSockopt

Jump to: navigation, search

Table of Contents >> Application Reference >> Telnet Daemon


#include <trsocket.h>


int tfTeldUserSetSockopt (
ttUserTeldSrvHandle userSrvHandle,
int protocolLevel,
int optionName,
void * optionValuePtr,
int optionLength
);


Function Description

This API that allows the user to change the socket options on the Telnet server listening socket using the server handle returned by tfTeldUserCreate(). User should call tfTeldUserSetSockopt() before calling tfTeldUserExecuteHandle(). This call is similar to setsockopt(). The only difference is that it takes a Telnet server handle as its first argument instead of a socket descriptor.

If you are using the Strong End System Model (configuration macro TM_USE_STRONG_ESL) to bind multiple servers to different interfaces, you should call tfTeldUserSetSockopt() with the SO_BINDTODEVICE option prior to calling tfTeldUserBind().


Parameters

  • userSrvHandle
    The server handle, as returned by tfTeldUserCreate().
  • protocolLevel
    The protocol option level (see setsockopt()).
  • optionName
    The option name to set. See setsockopt() for a full list of options.
  • optionValuePtr
    The pointer to a user variable containing the new option value.
  • optionLength
    The size of the user variable. It is the size of the option data type (see setsockopt()).


Returns

  • TM_ENOERROR
    Success
  • TM_EPERM
    Not initialized; call tfTeldUserInit() first, or
    Not allowed after starting server.
  • TM_EINVAL
    Invalid parameter.
  • TM_ESHUTDOWN
    Server has stopped.
  • . . .
    (See setsockopt() for additional error codes).


Table of Contents >> Application Reference >> Telnet Daemon