On 2022-01-20, Grant Edwards <grant.b.edwa...@gmail.com> wrote: > I'm running into a problem where netconn_connect always returns OK > immediately, even when the connection was refused by the server (it > replies to the SYN with a RST). Subsequent attempts to write to the > connection return -14 (ERR_RST) or -11 (ERR_CONN). > > Shouldn't netconn_connect() return an error if the connection was > refused? If the server accepts the conneciton, it seems to work OK.
There's actually another strange netconn_connect() behavior I've noticed. I have a test app with 4 client threads that repeatedly connect to a server, exchange data for a few seconds, then disconnect. The first three threads that call netconn_connect() get error codes 2,3,4 (always in that order). The fourth thread always connects and returns OK. A couple seconds later, the first three connect OK. Subsequent connects always work. Obvserving the network traffic for the three "failures" show that the SYN/SYN-ACK/ACK handshake was completed, then the lwIP side immediately closed the connection with a FIN. Any ideas on what would cause that sort of behavior? _______________________________________________ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users