How can I know if a TCP Send was successful

#1

I’m planning a system using multi sockets.
If my code performs a TCP send using Z, and the socket times out, what notification will my microcontroller receive?

#2

Hi

If you have socket time out, your MCU receive the [ERROR:SOCKET FAILURE] message from WizFi210.

#3

In that case, how can I know which socket timed out?

#4

Hi

WizFi210 does not have message for only socket timeout. If WizFi210 occure socket timeout, WizFi210 will send [ERROR:SOCKET FAILURE].

But, In default mode of WizFi210, You don’t see this error message. Because WizFi210 has default TCP retransmission timeout is infinite.
So using retransmission timeout, You need to enter command as below after create socket cid.

[quote]AT+WD
[OK]
AT+WWPA=12345678
[OK]
AT+XDUM=0
[OK]
AT+NDHCP=1
[OK]
AT+WA=WiznetKaizen
IP SubNet Gateway
192.168.15.42: 255.255.255.0: 192.168.15.1
[OK]
AT+NCTCP=222.98.xxx.xxx,6000
[CONNECT 0]

[OK]
AT+SETSOCKOPT=0,6,10,20,4
[OK]
AT+SETSOCKOPT=0,65535,8,1,4
[OK]
AT+SETSOCKOPT=0,6,4005,1,4
[OK]
AT+SETSOCKOPT=0,6,4001,75,4
[OK]
AT+CID=?
CID TYPE MODE LOCAL PORT REMOTE PORT REMOTE IP
0 TCP CLIENT 36486 6000 222. 98.xxx.xxx

[OK]

[color=#FF0000]Disconnect LAN cable on PC
WizFi210 send data to PC

After 10sec, You will see error message
[/color]
[ERROR: SOCKET FAILURE]
[/quote]