gi-gio-2.0.32: Gio bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | Safe-Inferred
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.

In UNIX terms, `GInetSocketAddress` corresponds to a `struct sockaddr_in` or `struct sockaddr_in6`).

Synopsis

- newtype InetSocketAddress = InetSocketAddress (ManagedPtr InetSocketAddress)
- class (GObject o, IsDescendantOf InetSocketAddress o) => IsInetSocketAddress o
- toInetSocketAddress :: (MonadIO m, IsInetSocketAddress o) => o -> m 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 (Maybe InetSocketAddress)
- constructInetSocketAddressAddress :: (IsInetSocketAddress o, MonadIO m, IsInetAddress a) => a -> m (GValueConstruct o)
- getInetSocketAddressAddress :: (MonadIO m, IsInetSocketAddress o) => o -> m InetAddress
- constructInetSocketAddressFlowinfo :: (IsInetSocketAddress o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getInetSocketAddressFlowinfo :: (MonadIO m, IsInetSocketAddress o) => o -> m Word32
- constructInetSocketAddressPort :: (IsInetSocketAddress o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getInetSocketAddressPort :: (MonadIO m, IsInetSocketAddress o) => o -> m Word32
- constructInetSocketAddressScopeId :: (IsInetSocketAddress o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getInetSocketAddressScopeId :: (MonadIO m, IsInetSocketAddress o) => o -> m Word32

# Exported types

newtype InetSocketAddress Source #

Memory-managed wrapper type.

Constructors

InetSocketAddress (ManagedPtr InetSocketAddress) |

#### Instances

Instances details

Eq InetSocketAddress Source # |
Instance details Defined in GI.Gio.Objects.InetSocketAddress Methods (==) :: InetSocketAddress -> InetSocketAddress -> Bool Source # (/=) :: InetSocketAddress -> InetSocketAddress -> Bool Source #
GObject InetSocketAddress Source # |
Instance details Defined in GI.Gio.Objects.InetSocketAddress
ManagedPtrNewtype InetSocketAddress Source # |
Instance details Defined in GI.Gio.Objects.InetSocketAddress Methods toManagedPtr :: InetSocketAddress -> ManagedPtr InetSocketAddress Source #
TypedObject InetSocketAddress Source # |
Instance details Defined in GI.Gio.Objects.InetSocketAddress Methods glibType :: IO GType Source #
HasParentTypes InetSocketAddress Source # |
Instance details Defined in GI.Gio.Objects.InetSocketAddress
IsGValue (Maybe InetSocketAddress) Source # | Convert `InetSocketAddress` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gio.Objects.InetSocketAddress Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe InetSocketAddress -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe InetSocketAddress) Source #
type ParentTypes InetSocketAddress Source # |
Instance details Defined in GI.Gio.Objects.InetSocketAddress type ParentTypes InetSocketAddress = '[SocketAddress, Object, SocketConnectable]

class (GObject o, IsDescendantOf InetSocketAddress o) => IsInetSocketAddress o Source #

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

#### Instances

Instances details

(GObject o, IsDescendantOf InetSocketAddress o) => IsInetSocketAddress o Source # |
Instance details Defined in GI.Gio.Objects.InetSocketAddress

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`.

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

bindProperty, bindPropertyFull, enumerate, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, proxyEnumerate, ref, refSink, runDispose, stealData, stealQdata, thawNotify, toNative, toString, unref, watchClosure.

#### Getters

getAddress, getData, getFamily, getFlowinfo, getNativeSize, getPort, getProperty, getQdata, getScopeId.

#### Setters

setData, setDataFull, setProperty.

## getAddress

inetSocketAddressGetAddress Source #

Arguments

:: (HasCallStack, MonadIO m, IsInetSocketAddress a) |
=> a | `address`: a `InetSocketAddress`
-> m InetAddress | Returns: the `InetAddress` for `address`, which must be `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 (Maybe 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

The address.

Since: 2.22

constructInetSocketAddressAddress :: (IsInetSocketAddress o, MonadIO m, IsInetAddress a) => a -> m (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, MonadIO m) => Word32 -> m (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

The port.

Since: 2.22

constructInetSocketAddressPort :: (IsInetSocketAddress o, MonadIO m) => Word32 -> m (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

The `sin6_scope_id` field, for IPv6 addresses.

Since: 2.32

constructInetSocketAddressScopeId :: (IsInetSocketAddress o, MonadIO m) => Word32 -> m (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