• WiFi
  • WINC1500 web server accept and close issue
2020/09/17 23:22:21
I'm implementing a web server with a WINC1500, and a TCP server based on Microchip examples.
Connection is ok, and after socket() bind() listen() my device is waiting for an incoming request (http get).
The first problem is that I receive several SOCKET_MSG_ACCEPT callback, sometimes 2 in a row, or a second one later during data exchange.
How do I have to handle that ?
Can I discard all accept callback until the end of the transaction ? Anyway, if I call a recv() for each accept, I get only one SOCKET_MSG_RECV.
The second problem is :
How do I have to close the session properly (when the web page is sent back) ?
Must both client and server sockets be closed ?
When I do that, and recreate a socket(), the freed number is reused, but I get the error SOCK_ERR_ADDR_ALREADY_IN_USE.
It looks like the socket was not actually close.
After the first session, no way to restart a new one. Next http requests give errors  SOCK_ERR_CONN_ABORTED.
Any clue about this behaviour ?
My WINC1500 version : 
jan 2017
Driver V19.3.0   Firmware V19.5.2   Firmware svnnum 14274
Could an update fix this problem ?
Thanks for your help
© 2021 APG vNext Commercial Version 4.5

Use My Existing Forum Account