### Method

# Gio Socket get_protocol

since: 2.22

#### Declaration [src]

    GSocketProtocol
    g_socket_get_protocol (
      GSocket* socket
    )

#### Description [src]

Gets the socket protocol id the socket was created with. In case the protocol is unknown, -1 is returned.

Available since: 2.22

Gets property | `Gio.Socket:protocol`

#### Return value

Type: `GSocketProtocol`

A protocol id, or -1 if unknown.