Gio.Socket.get_protocol

### Method

# Gio Socketget_protocol

since: 2.22

#### Declaration

    GSocketProtocol
    g_socket_get_protocol (
      GSocket* socket
    )

#### Description

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.