You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the getfd method on the socket types in this project seems to be unstable as outlined in this comment from the tcp reference docs
Note: This is an internal method. Unlikely to be portable. Use at your own risk.
It is incredibly difficult to know which socket passed to select has caused this failure.
It is also very difficult to recover from this error since it is difficult to predict what FD will be returned by the OS at any given time and since an FD isn't allocated for unconnected sockets, there isn't a great way to surface an error if the FD is too large.
I see a few ways this could be solved.
Return the invalid socket(s) as part of the error return, after the string "descriptor too large for set size"/"too many sockets".
Swap out the underlying mechanism of socket.select to use poll as that is also posix compliant and should be generally portable.
Provide an alternative socket.poll that uses the posix poll and allow callers to pick which API they want to use
Stabilize and document getfd for all sockets on all platforms to at least give consumers an escape hatch
Does the project have a preference here? Personally I would love to see 2 if possible and would be happy to try and get a PR opened for the change
The text was updated successfully, but these errors were encountered:
Since the
getfd
method on the socket types in this project seems to be unstable as outlined in this comment from the tcp reference docsIt is incredibly difficult to know which socket passed to
select
has caused this failure.It is also very difficult to recover from this error since it is difficult to predict what FD will be returned by the OS at any given time and since an FD isn't allocated for unconnected sockets, there isn't a great way to surface an error if the FD is too large.
I see a few ways this could be solved.
"descriptor too large for set size"
/"too many sockets"
.socket.select
to usepoll
as that is also posix compliant and should be generally portable.socket.poll
that uses the posixpoll
and allow callers to pick which API they want to usegetfd
for all sockets on all platforms to at least give consumers an escape hatchDoes the project have a preference here? Personally I would love to see 2 if possible and would be happy to try and get a PR opened for the change
The text was updated successfully, but these errors were encountered: