Macros

#define TCP_MAX_PACKET_SIZE   1460L
 

TCP state

use with tcp_get_state()

#define TCP_CLOSED   0
 
#define TCP_LISTEN   1
 
#define TCP_SYN_SENT   2
 
#define TCP_SYN_RECEIVED   3
 
#define TCP_ESTABLISHED   4
 

TCP options

use with tcp_set_option()

#define TCP_UNA_SEG   1 /* TCP unacknowledged segment size */
 
#define TCP_RETRANS_DELAY   2 /* TCP retransmit delay time */
 

Detailed Description

Macro Definition Documentation

#define TCP_MAX_PACKET_SIZE   1460L
Examples:
Blocksend.c, SMTP.c, and Telnet.c.
#define TCP_CLOSED   0

TCP Socket Closed

#define TCP_LISTEN   1

TCP Socket Listening for connection

#define TCP_SYN_SENT   2

TCP Socket Active, have sent SYN

#define TCP_SYN_RECEIVED   3

TCP Socket Have sent and received SYN

#define TCP_ESTABLISHED   4

TCP Socket Established

#define TCP_UNA_SEG   1 /* TCP unacknowledged segment size */

This option specifies the amount of data that may be sent out without waiting for acknowledge or delaying further sends. It may be a performance issue to increase the size of pending data.

See also
tcp_set_option()

TCP unacknowledged segment size

1 // ***************************************************************************
2 // set TCP option for unacknowledged packet segment size of 4380 bytes
3 // ***************************************************************************
4 tcp_set_option (socket, TCP_UNA_SEG, 3*1460);
Examples:
Blocksend.c.
#define TCP_RETRANS_DELAY   2 /* TCP retransmit delay time */

If calling the net_isq() is delayed by a heavy signal processing load, it may be necessary to decrease the TCP retransmit delay. The delay should be between 1 (very short delay) and 4096 (very long delay). Most default values are between 64 and 512 (depending on DSP and clock).

See also
tcp_set_option()

TCP retransmit delay time

1 // ***************************************************************************
2 // set shorter TCP retransmit delay
3 // ***************************************************************************
4 tcp_set_option (socket, TCP_RETRANS_DELAY, 0x40);