lwIP - A Lightweight TCP/IP stack - Bugs: bug #31590, getsockopt(... SO_ERROR ...) gives...
You are not allowed to post comments on this tracker with your current authentication level.
bug #31590: getsockopt(... SO_ERROR ...) gives EINPROGRESS after a successful nonblocking connection.
Submitter: | Ken MacKay <kmackay> | ||
Submitted: | Tue 09 Nov 2010 12:10:10 AM UTC | ||
Category: | TCP | Severity: | 3 - Normal |
Item Group: | Faulty Behaviour | Status: | Fixed |
Privacy: | Public | Assigned to: | goldsimon |
Open/Closed: | Closed | Planned Release: | None |
lwIP version: | CVS Head |
Mon 22 Nov 2010 08:57:02 PM UTC, comment #2: |
Simon Goldschmidt <goldsimon> |
Mon 22 Nov 2010 08:22:54 PM UTC, comment #1: The problem is that our SO_ERROR implementation always first returns an old socket error and only returns the underlying netconn error on the second call. In your case, that means the second return value is the correct one. I'll fix that. |
Simon Goldschmidt <goldsimon> |
Tue 09 Nov 2010 12:10:10 AM UTC, original submission:
If I create a new TCP socket and set it to be nonblocking, then call connect(), it returns -1 with errno set to EINPROGRESS as expected. I then call select() with the socket in the write set to determine when the connection has succeeded. This also works as expected. Now I need to determine if the socket is actually connected, or errored out. I use getsockopt(socket, SOL_SOCKET, SO_ERROR, ...) to get the socket error code if any.
|
Ken MacKay <kmackay> |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 4 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2010-11-22 | goldsimon | Status | In Progress | Fixed | |
Open/Closed | Open | Closed | |||
2010-11-22 | goldsimon | Status | None | In Progress | |
Assigned to | None | goldsimon |
Powered by Savane 3.13-f8d8.
Corresponding source code
Fixed by letting getsockopt overwriting 0 and temporary errors in sock->err (currently, only EINPROGRESS is temporary, all other errors are generated by the application calling socket functions).
Thanks for reporting!