### Method

# Gio Socket get_fd

since: 2.22

#### Declaration

    int
    g_socket_get_fd (
      GSocket* socket
    )

#### Description

Returns the underlying OS socket object. 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.

Available since: 2.22

Gets property | `Gio.Socket:fd`

#### Return value

Type: `int`

The file descriptor of the socket.