gi-gio-2.0.19: Gio bindings

Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com)
Safe Haskell | None
Language | Haskell2010

GI.Gio.Objects.InetSocketAddress

Contents

- Exported types
- Methods
  - getAddress
  - getFlowinfo
  - getPort
  - getScopeId
  - new
  - newFromString
- Properties
  - address
  - flowinfo
  - port
  - scopeId

Description

An IPv4 or IPv6 socket address; that is, the combination of a `InetAddress` and a port number.

Synopsis

- newtype InetSocketAddress = InetSocketAddress (ManagedPtr InetSocketAddress)
- class GObject o => IsInetSocketAddress o
- toInetSocketAddress :: (MonadIO m, IsInetSocketAddress o) => o -> m InetSocketAddress
- noInetSocketAddress :: Maybe InetSocketAddress
- inetSocketAddressGetAddress :: (HasCallStack, MonadIO m, IsInetSocketAddress a) => a -> m InetAddress
- inetSocketAddressGetFlowinfo :: (HasCallStack, MonadIO m, IsInetSocketAddress a) => a -> m Word32
- inetSocketAddressGetPort :: (HasCallStack, MonadIO m, IsInetSocketAddress a) => a -> m Word16
- inetSocketAddressGetScopeId :: (HasCallStack, MonadIO m, IsInetSocketAddress a) => a -> m Word32
- inetSocketAddressNew :: (HasCallStack, MonadIO m, IsInetAddress a) => a -> Word16 -> m InetSocketAddress
- inetSocketAddressNewFromString :: (HasCallStack, MonadIO m) => Text -> Word32 -> m InetSocketAddress
- constructInetSocketAddressAddress :: (IsInetSocketAddress o, IsInetAddress a) => a -> IO (GValueConstruct o)
- getInetSocketAddressAddress :: (MonadIO m, IsInetSocketAddress o) => o -> m InetAddress
- constructInetSocketAddressFlowinfo :: IsInetSocketAddress o => Word32 -> IO (GValueConstruct o)
- getInetSocketAddressFlowinfo :: (MonadIO m, IsInetSocketAddress o) => o -> m Word32
- constructInetSocketAddressPort :: IsInetSocketAddress o => Word32 -> IO (GValueConstruct o)
- getInetSocketAddressPort :: (MonadIO m, IsInetSocketAddress o) => o -> m Word32
- constructInetSocketAddressScopeId :: IsInetSocketAddress o => Word32 -> IO (GValueConstruct o)
- getInetSocketAddressScopeId :: (MonadIO m, IsInetSocketAddress o) => o -> m Word32

# Exported types

newtype InetSocketAddress Source #

Memory-managed wrapper type.

Constructors

InetSocketAddress (ManagedPtr InetSocketAddress) |

Instances

GObject InetSocketAddress Source # |
Instance details Defined in GI.Gio.Objects.InetSocketAddress Methods gobjectType :: InetSocketAddress -> IO GType Source #
IsObject InetSocketAddress Source # |
Instance details Defined in GI.Gio.Objects.InetSocketAddress
IsSocketConnectable InetSocketAddress Source # |
Instance details Defined in GI.Gio.Objects.InetSocketAddress
IsInetSocketAddress InetSocketAddress Source # |
Instance details Defined in GI.Gio.Objects.InetSocketAddress
IsSocketAddress InetSocketAddress Source # |
Instance details Defined in GI.Gio.Objects.InetSocketAddress

class GObject o => IsInetSocketAddress o Source #

Type class for types which can be safely cast to `InetSocketAddress`, for instance with `toInetSocketAddress`.

Instances

(GObject a, (UnknownAncestorError InetSocketAddress a :: Constraint)) => IsInetSocketAddress a Source # |
Instance details Defined in GI.Gio.Objects.InetSocketAddress
IsInetSocketAddress InetSocketAddress Source # |
Instance details Defined in GI.Gio.Objects.InetSocketAddress
IsInetSocketAddress ProxyAddress Source # |
Instance details Defined in GI.Gio.Objects.ProxyAddress

toInetSocketAddress :: (MonadIO m, IsInetSocketAddress o) => o -> m InetSocketAddress Source #

Cast to `InetSocketAddress`, for types for which this is known to be safe. For general casts, use `castTo`.

noInetSocketAddress :: Maybe InetSocketAddress Source #

A convenience alias for `Nothing` :: `Maybe` `InetSocketAddress`.

# Methods

## getAddress

inetSocketAddressGetAddress Source #

Arguments

:: (HasCallStack, MonadIO m, IsInetSocketAddress a) |
=> a | `address`: a `InetSocketAddress`
-> m InetAddress | Returns: the `InetAddress` for `address`, which must be 'GI.GObject.Objects.Object.objectRef'\'d if it will be stored

Gets `address`'s `InetAddress`.

Since: 2.22

## getFlowinfo

inetSocketAddressGetFlowinfo Source #

Arguments

:: (HasCallStack, MonadIO m, IsInetSocketAddress a) |
=> a | `address`: a `SocketFamilyIpv6` `InetSocketAddress`
-> m Word32 | Returns: the flowinfo field

Gets the `sin6_flowinfo` field from `address`, which must be an IPv6 address.

Since: 2.32

## getPort

inetSocketAddressGetPort Source #

Arguments

:: (HasCallStack, MonadIO m, IsInetSocketAddress a) |
=> a | `address`: a `InetSocketAddress`
-> m Word16 | Returns: the port for `address`

Gets `address`'s port.

Since: 2.22

## getScopeId

inetSocketAddressGetScopeId Source #

Arguments

:: (HasCallStack, MonadIO m, IsInetSocketAddress a) |
=> a | `address`: a `SocketFamilyIpv6` `InetAddress`
-> m Word32 | Returns: the scope id field

Gets the `sin6_scope_id` field from `address`, which must be an IPv6 address.

Since: 2.32

## new

inetSocketAddressNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsInetAddress a) |
=> a | `address`: a `InetAddress`
-> Word16 | `port`: a port number
-> m InetSocketAddress | Returns: a new `InetSocketAddress`

Creates a new `InetSocketAddress` for `address` and `port`.

Since: 2.22

## newFromString

inetSocketAddressNewFromString Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Text | `address`: the string form of an IP address
-> Word32 | `port`: a port number
-> m InetSocketAddress | Returns: a new `InetSocketAddress`, or `Nothing` if `address` cannot be parsed.

Creates a new `InetSocketAddress` for `address` and `port`.

If `address` is an IPv6 address, it can also contain a scope ID (separated from the address by a `%`).

Since: 2.40

# Properties

## address

No description available in the introspection data.

constructInetSocketAddressAddress :: (IsInetSocketAddress o, IsInetAddress a) => a -> IO (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`address`” property. This is rarely needed directly, but it is used by `new`.

getInetSocketAddressAddress :: (MonadIO m, IsInetSocketAddress o) => o -> m InetAddress Source #

Get the value of the “`address`” property. When overloading is enabled, this is equivalent to

    get inetSocketAddress #address

## flowinfo

The `sin6_flowinfo` field, for IPv6 addresses.

Since: 2.32

constructInetSocketAddressFlowinfo :: IsInetSocketAddress o => Word32 -> IO (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`flowinfo`” property. This is rarely needed directly, but it is used by `new`.

getInetSocketAddressFlowinfo :: (MonadIO m, IsInetSocketAddress o) => o -> m Word32 Source #

Get the value of the “`flowinfo`” property. When overloading is enabled, this is equivalent to

    get inetSocketAddress #flowinfo

## port

No description available in the introspection data.

constructInetSocketAddressPort :: IsInetSocketAddress o => Word32 -> IO (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`port`” property. This is rarely needed directly, but it is used by `new`.

getInetSocketAddressPort :: (MonadIO m, IsInetSocketAddress o) => o -> m Word32 Source #

Get the value of the “`port`” property. When overloading is enabled, this is equivalent to

    get inetSocketAddress #port

## scopeId

No description available in the introspection data.

constructInetSocketAddressScopeId :: IsInetSocketAddress o => Word32 -> IO (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`scope-id`” property. This is rarely needed directly, but it is used by `new`.

getInetSocketAddressScopeId :: (MonadIO m, IsInetSocketAddress o) => o -> m Word32 Source #

Get the value of the “`scope-id`” property. When overloading is enabled, this is equivalent to

    get inetSocketAddress #scopeId