Configuration of the TCP sockets in µVision.
Configuration of the TCP sockets in µVision.
TCP Socket Configuration File
The TCP sockets configuration file Net_Config_TCP.h contains the following settings:
- Number of TCP Sockets specifies the number of available TCP sockets. This number specifies the maximum number of simultaneously opened TCP connections.
- Number of Retries specifies the number of retransmissions before the TCP module gives up. Data is retransmitted if it is not acknowledged within the timeout frame defined by the Retry Timeout in seconds.
- Retry Timeout in seconds is the timeout after which the TCP module retransmits the data. This is the initial timeout value. When the data exchange is going on, the system measures the response time and corrects this timeout.
- Default Connect Timeout in seconds is the default keep-alive timeout. After this timeout has expired, the TCP link is either:
- disconnected when TCP keep-alive is not enabled.
- retained when TCP keep-alive is enabled by sending a keep-alive message to prevent the link from being broken.
This parameter is used for services such as HTTP Server and Telnet Server.
- Maximum Segment Size (MSS) specifies the maximum number of bytes in the TCP segment's data field. Acceptable values for this parameter are in the range from 536 to 1440 bytes. This value is used by default for any TCP communication. Use netTCP_GetMaxSegmentSize to determine the actual MSS that can be used in a data transmission.
- Receive Window Size specifies the amount of data the TCP socket is able to buffer.
Additional configuration settings for TCP sockets:
- TCP_INITIAL_RETRY_TOUT defines the initial retransmission period in seconds.
- TCP_SYN_RETRY_TOUT defines the subsequent SYN frame retransmission periods in seconds.
- TCP_CONNECT_RETRY defines the number of retries to establish a connection.
These settings are used when the socket connects to a remote server. It is recommended that you keep the default setting.
- TCP_DYN_PORT_START defines the beginning of the dynamic port range.
- TCP_DYN_PORT_END defines the end of the dynamic port range.
The default dynamic port range, also called private ports, is from 49152 to 65535. TCP dynamic ports are selected in this range if the system itself selects the local TCP port. It is recommended that you keep the default setting.