tfSmtpUserSetSockOpt
Table of Contents >> Optional Protocols >> SMTP
#include <trsocket.h> |
int tfSmtpUserSetSockOpt | ( |
ttSmtpClientHandle smtpClientHandle, | |
int family, | |
int protocolLevel, | |
int optionName, | |
const char TM_FAR * optionValuePtr, | |
int optionLength | |
); |
Function Description
This is a wrapper function for setsockopt(). It allows you to change the characteristics of the underlying TCP socket used by the SMTP session. This call must be made prior to connecting. You will not be permitted to set socket options after calling tfSmtpUserConnect(). Socket option TCP_NODELAY is set by default.
Parameters
- smtpClientHandle
- The SMTP client session handle as returned by tfSmtpUserNewSession().
- family
- The address family (AF_INET or AF_INET6) that will be used when you connect to the server (see tfSmtpUserConnect()).
- protocolLevel
- The protocol to set the option on (see setsockopt()).
- optionName
- The name of the option to set (see setsockopt()).
- optionValuePtr
- A pointer to a user variable from which the option value is set. Refer to setsockopt() for the required variable data type.
- optionLength
- The size of the user variable. Refer to setsockopt() for the required variable data size.
Returns
- TM_ENOERROR
- Success.
- TM_EINVAL
- Invalid SMTP client session handle.
- TM_EPERM
- Cannot set socket options after calling tfSmtpUserConnect().
- other values
- As returned by socket() or setsockopt().