lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] netconn_connect returns OK when connection refused?


From: Simon Goldschmidt
Subject: Re: [lwip-users] netconn_connect returns OK when connection refused?
Date: Tue, 12 Apr 2022 16:40:19 +0200
User-agent: K-9 Mail for Android


Am 11. April 2022 22:43:59 MESZ schrieb Grant Edwards 
<grant.b.edwards@gmail.com>:
>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.
>>
>> Here's the relevent code:
>>
>>
>>       conn = netconn_new(NETCONN_TCP);
>>       if (!conn)
>>         {
>>           printf("conn NULL\n");
>>           return;
>>         }
>>       e = netconn_connect(conn, &ip, 7000);
>>       if (e != ERR_OK)
>>         {
>>           printf("%s[%d] netconn_connect e=%d\n",__func__,exinf,e);
>>           netconn_delete(conn);
>>           return;
>>         }
>>       printf("connected\n");
>>       ...
>>           e = netconn_write_partly(conn, data, dsize, NETCONN_COPY, 
>> &written);
>>           if (e != ERR_OK)
>>             printf("%s[%d] netconn_write e=%d\n",__func__,exinf,e);
>
>I'm still stumped by this. It's 100% reliable: netconn_connect()
>returns ERR_OK even though the server responded to the SYN
>with a RST. Subsequent writes to that connection fail.
>
>I get the same resutls using the socket api. The call to connect()
>returns 0, but then send() fails.
>
>Nobody else has seen this?

No, but if you think this is a bug, please file a bug report!

Regards,
Simon

>
>
>
>_______________________________________________
>lwip-users mailing list
>lwip-users@nongnu.org
>https://lists.nongnu.org/mailman/listinfo/lwip-users



reply via email to

[Prev in Thread] Current Thread [Next in Thread]