tfTeldUserBind
Table of Contents >> Application Reference >> Telnet Daemon
| #include <trsocket.h> |
| int tfTeldUserBind | ( |
| ttUserTeldSrvHandle userSrvHandle, | |
| const struct sockaddr_storage TM_FAR * sockAddrPtr | |
| ); |
Function Description
This function binds the specified server to a port and IP address. This function must be called prior to calling tfTeldUserExecuteHandle(). 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().You can specify a NULL value for sockAddrPtr to use the default TELNET server binding (see the discussion below).
Parameters
- userSrvHandle
- The server handle, as returned by tfTeldUserCreate().
- sockAddrPtr
- The pointer to a socket address at which to accept connections. Include the address family (AF_INET or AF_INET6), IP address, port number, and structure length.
Specify a NULL pointer to accept connections on the default Telnet port (23), any local IP address, any interface, and for any supported address family.
- The pointer to a socket address at which to accept connections. Include the address family (AF_INET or AF_INET6), IP address, port number, and structure length.
Returns
- TM_ENOERROR
- Success
- TM_EPERM
- Not initialized; call tfTeldUserInit() first, or
Server is already running.
- Not initialized; call tfTeldUserInit() first, or
- TM_ESHUTDOWN
- Server is stopped.
- TM_EINVAL
- Invalid parameter.
- TM_EADDRINUSE
- The address is already in use.