|
From: | address@hidden |
Subject: | Re: [lwip-users] netconn_connect returns OK when connection refused? |
Date: | Fri, 21 Jan 2022 17:30:30 +0100 |
User-agent: | Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 |
Am 21.01.2022 um 15:37 schrieb Grant Edwards:
On 2022-01-20, Grant Edwards <grant.b.edwards@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).
I'm not sure what you mean here. err_t error codes should be negative. With "2,3,4", do you mean ERR_BUF, ERR_TIMEOUT, ERR_RTE? That would be strange. Regards, Simon
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
[Prev in Thread] | Current Thread | [Next in Thread] |