tfSntpUserSetSockOpt

Jump to: navigation, search

Table of Contents >> Application Reference >> Simple Network Time Protocol


#include <trsocket.h>


int tfSntpUserSetSockOpt (
ttSntpHandle sntpHandle,
int protocolLevel,
int optionName,
void TM_FAR * optionValuePtr,
int optionLength
);


Function Description

Set an option on the underlying UDP socket for an association. This is a wrapper function that calls setsockopt() (refer to that page for additional information).

If you are using the Strong End System Model (configuration macro TM_USE_STRONG_ESL), you can call tfSntpUserSetSockOpt() with the SO_BINDTODEVICE option to restrict I/O to a specific interface.


Parameters

  • sntpHandle
    The SNTP client handle returned by tfSntpUserCreate().
  • protocolLevel
    The protocol level of the option to set, e.g. SOL_SOCKET.
  • optionName
    The socket option to set (see setsockopt()).
  • optionValuePtr
    A pointer to the value to set.
  • optionLength
    The size of the value to set.


Returns

  • TM_ENOERROR
    Success.
  • TM_EINVAL
    Invalid handle, option or length or optionValuePtr is NULL.
  • (more)
    Other socket errors are possible. See setsockopt().


Table of Contents >> Application Reference >> Simple Network Time Protocol