get_fd


Description:

public int get_fd ()

Gets the underlying OS socket descriptor.

On Unix this is a socket file descriptor, and on Windows this is a Winsock2 `SOCKET` handle.

This may be useful for doing platform specific or otherwise unusual operations on the socket.

Parameters:

this

a socket

Returns:

the file descriptor of the socket, or `-1` if the socket has not yet been initialised or has been closed