|Subject:||[lwip-users] Netconn API and nonblocking connect - how to proceed after unsuccessful connection|
|Date:||Mon, 23 Jul 2012 16:40:23 +0200|
i'm coding around with the nonblocking TCP connect and the use of the callback routine. As the possible cases are not very well documented, I've got stuck in a situation after an unsuccessful netconn_connect as follows:
A handler should try to connect a TCP server. if the connection fails, it should retry periodically to connect again to this client with some seconds of waiting between the attempts.
This is how I did this:
1. Getting a new netconn for the connection
2. Set the connection to nonblocking
3. Try to connect to the remote host
err returns as -4 (in progress)
As the host is not running a service on this port, the callback immediately returns the ERROR
4. The ERROR causes the handler to wait the given seconds for this connection
5. For the next attempt, go again to step 3 (netconn_connect) to try again to connect
-> But now I'm always getting back the error code -12 (ERR_CLSD).
Why are the second and any following attempts not working and why do I always get back the ERR_CLSD without any connection attempts?
|[Prev in Thread]||Current Thread||[Next in Thread]|