The given socket must be in a connected state. It will be automatically
switched to non-blocking mode if necessary. Beware that this may have
side effects in other code that uses the socket and assumes blocking
operations.
Returns a socket handle corresponding to the passed socket
descriptor. If the same file descriptor is already registered,
StreamSocketFD.invalid will be returned instead.
Adopts an existing stream socket.
The given socket must be in a connected state. It will be automatically switched to non-blocking mode if necessary. Beware that this may have side effects in other code that uses the socket and assumes blocking operations.