Instructions

266Libraries
© 2013 Conrad Electronic
Description
Informs about the status of the connection. Since the other party can cancel a TCP / IP connection at any
time, the status of the program should be monitored periodically in the main loop.
The sock_id parameter is returned either by ETH_ConnectTCP, or you get it as info [0] value of
ETH_CheckReceiveBuf.
Parameter
sock_id Socket Index
Return Parameter
Connection state
State Table
#define
Value
Meaning
ES_DISCONNECTED
0
no TCP/IP connection
ES_CONNECTING
1
connection request initiated (ETH_ConnectTCP)
ES_CONNECTED
2
connection is open (ETH_ConnectTCP)
ES_LCONNECTED
3
connection is open (ETH_ListenTCP)
5.11.11 ETH_ListenTCP
Ethernet Functions
Syntax
word ETH_ListenTCP(word port);
Sub ETH_ListenTCP(port As Word) As Word
Description
Opens a listening socket on a TCP port. Received packets are stored in the buffer that was initialized with
ETH_SetConnBuf.
Parameter
port TCP Port
Return Parameter
handle to TCP listening Socket, 0 in case of error