TCP Raw API functions
API function
Description
tcp_new
Creates a new TCP PCB (protocol control block).
创建 TCP PCB(协议控制块)
tcp_bind
Binds a TCP PCB to a local IP address and port.
绑定 TCP PCB 到本地 IP 和端口
tcp_listen
Starts the listening process on the TCP PCB.
开始监听
tcp_accept
Assigns a callback function that will be called when a new TCP
connection arrives.
设置回调函数,在接收到新的 TCP 链接时调用
tcp_accepted
Informs the lwIP stack that an incoming TCP connection has
been accepted.
TCP connection setup
tcp_connect
Used to connect to a remote TCP host.
tcp_write
Queues up data to be sent.
tcp_sent
Assigns a callback function that will be called when sent data is
acknowledged by the remote host.
Sending TCP data
tcp_output
Forces queued data to be sent.
tcp_recv
Sets the callback function that will be called when new data
arrives
Receiving TCP data
tcp_recved
Must be called when the application has processed the incoming
data packet (for TCP window management).
Application polling
tcp_poll
Assigns a callback functions that will be called periodically. It
can be used by the application to check if there is remaining
application data that needs to be sent or if there are connections
that need to be closed.
tcp_close
Closes a TCP connection with a remote host.
tcp_err
Assigns a callback function for handling connections aborted by
the lwIP due to errors (such as memory shortage errors).
Closing and aborting
connections
tcp_abort
Aborts a TCP connection.