### Method

# Gio Socket get_local_address

since: 2.22

#### Declaration

    GSocketAddress*
    g_socket_get_local_address (
      GSocket* socket
      GError** error
    )

#### Description

Try to get the local address of a bound socket. This is only useful if the socket has been bound to a local address, either explicitly or implicitly when connecting.

Available since: 2.22

Gets property | `Gio.Socket:local-address`

#### Return value

Type: `GSocketAddress`

A `GSocketAddress` or `NULL` on error. Free the returned object with g_object_unref().

The caller of the method takes ownership of the data, and is responsible for freeing it.