gi-gio-2.0.25: Gio bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gio.Objects.SocketAddress

Contents

Description

tSocketAddress is the equivalent of struct sockaddr in the BSD sockets API. This is an abstract class; use tInetSocketAddress for internet sockets, or tUnixSocketAddress for UNIX domain sockets.

Synopsis

Exported types

newtype SocketAddress Source #

Memory-managed wrapper type.

Constructors

SocketAddress (ManagedPtr SocketAddress) 
Instances
Eq SocketAddress Source # 
Instance details

Defined in GI.Gio.Objects.SocketAddress

GObject SocketAddress Source # 
Instance details

Defined in GI.Gio.Objects.SocketAddress

Methods

gobjectType :: IO GType

IsGValue SocketAddress Source #

Convert SocketAddress to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Gio.Objects.SocketAddress

Methods

toGValue :: SocketAddress -> IO GValue

fromGValue :: GValue -> IO SocketAddress

HasParentTypes SocketAddress Source # 
Instance details

Defined in GI.Gio.Objects.SocketAddress

type ParentTypes SocketAddress Source # 
Instance details

Defined in GI.Gio.Objects.SocketAddress

type ParentTypes SocketAddress = Object ': (SocketConnectable ': ([] :: [Type]))

class (GObject o, IsDescendantOf SocketAddress o) => IsSocketAddress o Source #

Type class for types which can be safely cast to SocketAddress, for instance with toSocketAddress.

Instances
(GObject o, IsDescendantOf SocketAddress o) => IsSocketAddress o Source # 
Instance details

Defined in GI.Gio.Objects.SocketAddress

toSocketAddress :: (MonadIO m, IsSocketAddress o) => o -> m SocketAddress Source #

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

noSocketAddress :: Maybe SocketAddress Source #

A convenience alias for Nothing :: Maybe SocketAddress.

Methods

Overloaded methods

getFamily

socketAddressGetFamily Source #

Arguments

:: (HasCallStack, MonadIO m, IsSocketAddress a) 
=> a

address: a tSocketAddress

-> m SocketFamily

Returns: the socket family type of address

Gets the socket family type of address.

Since: 2.22

getNativeSize

socketAddressGetNativeSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsSocketAddress a) 
=> a

address: a tSocketAddress

-> m Int32

Returns: the size of the native struct sockaddr that address represents

Gets the size of address's native struct sockaddr. You can use this to allocate memory to pass to socketAddressToNative.

Since: 2.22

newFromNative

socketAddressNewFromNative Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Ptr ()

native: a pointer to a struct sockaddr

-> Word32

len: the size of the memory location pointed to by native

-> m SocketAddress

Returns: a new tSocketAddress if native could successfully be converted, otherwise Nothing

Creates a tSocketAddress subclass corresponding to the native struct sockaddr native.

Since: 2.22

toNative

socketAddressToNative Source #

Arguments

:: (HasCallStack, MonadIO m, IsSocketAddress a) 
=> a

address: a tSocketAddress

-> Ptr ()

dest: a pointer to a memory location that will contain the native struct sockaddr

-> Word32

destlen: the size of dest. Must be at least as large as socketAddressGetNativeSize

-> m ()

(Can throw GError)

Converts a tSocketAddress to a native struct sockaddr, which can be passed to low-level functions like connect() or bind().

If not enough space is available, a IOErrorEnumNoSpace error is returned. If the address type is not known on the system then a IOErrorEnumNotSupported error is returned.

Since: 2.22

Properties

family

No description available in the introspection data.

getSocketAddressFamily :: (MonadIO m, IsSocketAddress o) => o -> m SocketFamily Source #

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

get socketAddress #family