Socket.from_fd


Description:

public Socket.from_fd (int fd) throws Error

Creates a new Socket from a native file descriptor or winsock SOCKET handle.

This reads all the settings from the file descriptor so that all properties should work. Note that the file descriptor will be set to non-blocking mode, independent on the blocking mode of the Socket.

Parameters:

fd

a native socket file descriptor.

Returns:

a Socket or null on error. Free the returned object with unref.