WIZnet Developer Forum

Automatic reconnection to a TCP server


in my application, i manage a PUSH TCP function.
i successful run the TCP client on the WIZIFI250 module and connect to my TCP server. i can send my PUSH frame when required.

but sometime, the TCP server go down, or the WIFI link or maybe the TCP client of the module … don’t know exactly which one is the issue.
maybe a timeout on the server side which disconnect the client ?..

i would like to know if there is any configuration i can do, to automatically re connect or try re connection until the link is ok ?

thanks for any tips


Please refer to the following link and check AT+FSOCK=6, 8

wizwiki.net/wiki/doku.php?id=pro … t#at_fsock

hello Daniel,

please explain me a little more this command !..?
where i can specify which socket to apply ?

in my application, i have several sockets open… :
1 TCP server to serve a web server
1 TCP client to send PUSH frames
and several UDP socket to different features !

thanks, regards

Hi phil

Sorry, This function can support just 1 socket.
because this function recreate the socket using saved in flash memory(scon=s)
and the SCON=S command can overwrite the socket information in the flash memory. So, just 1 socket will be saved.

You can use Recreate socket or Reset the module when there is no socket connected using the following commands.

AT+WSET=(your configuration)
(your configuration)
AT+WNET=~~~~(your configuration)

AT+SCON=SO,5000,0 <<< as you know, the tcp server socket will create as 5000 port and saved flash memory.

AT+FSOCK=6,10 << you can choose FSOCK=6 or FSOCK=8. // FSOCK=6,10 << Check the Socket connected every 10 seconds. If disconnected, recreate the saved socket once again.(TCP Server 5000 port)
AT+FSOCK=8,30 << FSOCK=8,30 << Check the socket connected every 30 seconds, if disconnected, Reset the module and create the TCP Socket(5000 port)

AT+MPROF=S << previous commands must be saved.

well not sure to right understand …

==> which one is “supported” if several socket are open ?

anyway, this AT command seem not the right solution for my problem.


Copyright © 2017 WIZnet Co., Ltd. All Rights Reserved.