Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

µC/TCP-IP provides a set of APIs to configure sockets on an individual basis. These APIs are listed below and detailed in Network Socket Functions:

Generic Socket Option API

µC/TCP-IP provides two APIs to read and configure socket option values. These APIs are listed below and detailed in Network Socket Functions:

Their BSD equivalent are listed below. See also BSD Functions.

Controlling Socket Blocking Options

By default all sockets are configured to block. It is possible to change that behavior by using the socket option API NetSock_CfgBlock() or when by setting a flag before calling Socket API. It is also possible to change the default configuration, see in net_cfg.h for further details.

MSL

Maximum Segment Lifetime (MSL) is the time a TCP segment can exist in the network, and is defined as two minutes. 2MSL is twice this lifetime. It is the maximum lifetime of a TCP segment on the network because it supposes segment transmission and acknowledgment.

...

For UDP sockets, the sockets close() without delay. Thus, the next bind() is not blocked.

 

TCP Keep-Alives

µC/TCP-IP support TCP Keep-Alives. RFC  #1122 stipulate that "Keep-Alive mechanism periodically probes the other end of a connection when connection is otherwise idle, even when there is not data to be sent." 

It is possible to enable the Keep-Alive option for a specific socket by using the function NetSock_OptSet() () with the option NET_SOCK_OPT_SOCK_KEEP_ALIVE.

Knowing your TCP connection ID, you can also used the API function NetTCP_ConnCfgTxKeepAliveEn()().

Each time the connection Idle timeout occurs, the stack will send a keep-alive message to probe the other end of the connection. The timeout value for a given TCP connection can be set with the NetSock_OptSet() () function and the NET_SOCK_OPT_TCP_KEEP_IDLE option. Else, knowing your TCP connection ID, the API function NetTCP_ConnCfgIdleTimeout()()can also be use.