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

GI.Gio.Objects.UnixSocketAddress

Description

Support for UNIX-domain (also known as local) sockets, corresponding to struct sockaddr_un.

UNIX domain sockets are generally visible in the filesystem. However, some systems support abstract socket names which are not visible in the filesystem and not affected by the filesystem permissions, visibility, etc. Currently this is only supported under Linux. If you attempt to use abstract sockets on other systems, function calls may return G_IO_ERROR_NOT_SUPPORTED errors. You can use unixSocketAddressAbstractNamesSupported to see if abstract names are supported.

Since GLib 2.72, GUnixSocketAddress is available on all platforms. It requires underlying system support (such as Windows 10 with AF_UNIX) at run time.

Before GLib 2.72, <gio/gunixsocketaddress.h> belonged to the UNIX-specific GIO interfaces, thus you had to use the gio-unix-2.0.pc pkg-config file when using it. This is no longer necessary since GLib 2.72.

Synopsis

Exported types

newtype UnixSocketAddress Source #

Memory-managed wrapper type.

Instances

Instances details
Eq UnixSocketAddress Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

GObject UnixSocketAddress Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

ManagedPtrNewtype UnixSocketAddress Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

TypedObject UnixSocketAddress Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

Methods

glibType :: IO GType #

HasParentTypes UnixSocketAddress Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

HasAttributeList UnixSocketAddress Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

(info ~ ResolveUnixSocketAddressMethod t UnixSocketAddress, OverloadedMethod info UnixSocketAddress p, HasField t UnixSocketAddress p) => HasField (t :: Symbol) UnixSocketAddress (p :: Type) Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

(info ~ ResolveUnixSocketAddressMethod t UnixSocketAddress, OverloadedMethodInfo info UnixSocketAddress) => IsLabel t (MethodProxy info UnixSocketAddress) Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

(info ~ ResolveUnixSocketAddressMethod t UnixSocketAddress, OverloadedMethod info UnixSocketAddress p) => IsLabel t (UnixSocketAddress -> p) Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

IsGValue (Maybe UnixSocketAddress) Source #

Convert UnixSocketAddress to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttributeList UnixSocketAddress Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type ParentTypes UnixSocketAddress Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type SignalList UnixSocketAddress Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

class (GObject o, IsDescendantOf UnixSocketAddress o) => IsUnixSocketAddress o Source #

Type class for types which can be safely cast to UnixSocketAddress, for instance with toUnixSocketAddress.

Instances

Instances details
(GObject o, IsDescendantOf UnixSocketAddress o) => IsUnixSocketAddress o Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

toUnixSocketAddress :: (MonadIO m, IsUnixSocketAddress o) => o -> m UnixSocketAddress Source #

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

Methods

type family ResolveUnixSocketAddressMethod (t :: Symbol) o where ... Source #

Equations

ResolveUnixSocketAddressMethod "bindProperty" o = ObjectBindPropertyMethodInfo 
ResolveUnixSocketAddressMethod "bindPropertyFull" o = ObjectBindPropertyFullMethodInfo 
ResolveUnixSocketAddressMethod "enumerate" o = SocketConnectableEnumerateMethodInfo 
ResolveUnixSocketAddressMethod "forceFloating" o = ObjectForceFloatingMethodInfo 
ResolveUnixSocketAddressMethod "freezeNotify" o = ObjectFreezeNotifyMethodInfo 
ResolveUnixSocketAddressMethod "getv" o = ObjectGetvMethodInfo 
ResolveUnixSocketAddressMethod "isFloating" o = ObjectIsFloatingMethodInfo 
ResolveUnixSocketAddressMethod "notify" o = ObjectNotifyMethodInfo 
ResolveUnixSocketAddressMethod "notifyByPspec" o = ObjectNotifyByPspecMethodInfo 
ResolveUnixSocketAddressMethod "proxyEnumerate" o = SocketConnectableProxyEnumerateMethodInfo 
ResolveUnixSocketAddressMethod "ref" o = ObjectRefMethodInfo 
ResolveUnixSocketAddressMethod "refSink" o = ObjectRefSinkMethodInfo 
ResolveUnixSocketAddressMethod "runDispose" o = ObjectRunDisposeMethodInfo 
ResolveUnixSocketAddressMethod "stealData" o = ObjectStealDataMethodInfo 
ResolveUnixSocketAddressMethod "stealQdata" o = ObjectStealQdataMethodInfo 
ResolveUnixSocketAddressMethod "thawNotify" o = ObjectThawNotifyMethodInfo 
ResolveUnixSocketAddressMethod "toNative" o = SocketAddressToNativeMethodInfo 
ResolveUnixSocketAddressMethod "toString" o = SocketConnectableToStringMethodInfo 
ResolveUnixSocketAddressMethod "unref" o = ObjectUnrefMethodInfo 
ResolveUnixSocketAddressMethod "watchClosure" o = ObjectWatchClosureMethodInfo 
ResolveUnixSocketAddressMethod "getAddressType" o = UnixSocketAddressGetAddressTypeMethodInfo 
ResolveUnixSocketAddressMethod "getData" o = ObjectGetDataMethodInfo 
ResolveUnixSocketAddressMethod "getFamily" o = SocketAddressGetFamilyMethodInfo 
ResolveUnixSocketAddressMethod "getIsAbstract" o = UnixSocketAddressGetIsAbstractMethodInfo 
ResolveUnixSocketAddressMethod "getNativeSize" o = SocketAddressGetNativeSizeMethodInfo 
ResolveUnixSocketAddressMethod "getPath" o = UnixSocketAddressGetPathMethodInfo 
ResolveUnixSocketAddressMethod "getPathLen" o = UnixSocketAddressGetPathLenMethodInfo 
ResolveUnixSocketAddressMethod "getProperty" o = ObjectGetPropertyMethodInfo 
ResolveUnixSocketAddressMethod "getQdata" o = ObjectGetQdataMethodInfo 
ResolveUnixSocketAddressMethod "setData" o = ObjectSetDataMethodInfo 
ResolveUnixSocketAddressMethod "setDataFull" o = ObjectSetDataFullMethodInfo 
ResolveUnixSocketAddressMethod "setProperty" o = ObjectSetPropertyMethodInfo 
ResolveUnixSocketAddressMethod l o = MethodResolutionFailed l o :: Type 

abstractNamesSupported

unixSocketAddressAbstractNamesSupported Source #

Arguments

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

Returns: True if supported, False otherwise

Checks if abstract UNIX domain socket names are supported.

Since: 2.22

getAddressType

getIsAbstract

unixSocketAddressGetIsAbstract Source #

Arguments

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

address: a InetSocketAddress

-> m Bool

Returns: True if the address is abstract, False otherwise

Tests if address is abstract.

Since: 2.22

getPath

unixSocketAddressGetPath Source #

Arguments

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

address: a InetSocketAddress

-> m Text

Returns: the path for address

Gets address's path, or for abstract sockets the "name".

Guaranteed to be zero-terminated, but an abstract socket may contain embedded zeros, and thus you should use unixSocketAddressGetPathLen to get the true length of this string.

Since: 2.22

getPathLen

unixSocketAddressGetPathLen Source #

Arguments

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

address: a InetSocketAddress

-> m CSize

Returns: the length of the path

Gets the length of address's path.

For details, see unixSocketAddressGetPath.

Since: 2.22

new

unixSocketAddressNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

path: the socket path

-> m UnixSocketAddress

Returns: a new UnixSocketAddress

Creates a new UnixSocketAddress for path.

To create abstract socket addresses, on systems that support that, use unixSocketAddressNewAbstract.

Since: 2.22

newAbstract

newWithType

unixSocketAddressNewWithType Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> [Int8]

path: the name

-> UnixSocketAddressType

type: a UnixSocketAddressType

-> m UnixSocketAddress

Returns: a new UnixSocketAddress

Creates a new UnixSocketAddress of type type with name path.

If type is UnixSocketAddressTypePath, this is equivalent to calling unixSocketAddressNew.

If type is UnixSocketAddressTypeAnonymous, path and pathLen will be ignored.

If pathType is UnixSocketAddressTypeAbstract, then pathLen bytes of path will be copied to the socket's path, and only those bytes will be considered part of the name. (If pathLen is -1, then path is assumed to be NUL-terminated.) For example, if path was "test", then calling socketAddressGetNativeSize on the returned socket would return 7 (2 bytes of overhead, 1 byte for the abstract-socket indicator byte, and 4 bytes for the name "test").

If pathType is UnixSocketAddressTypeAbstractPadded, then pathLen bytes of path will be copied to the socket's path, the rest of the path will be padded with 0 bytes, and the entire zero-padded buffer will be considered the name. (As above, if pathLen is -1, then path is assumed to be NUL-terminated.) In this case, socketAddressGetNativeSize will always return the full size of a struct sockaddr_un, although unixSocketAddressGetPathLen will still return just the length of path.

UnixSocketAddressTypeAbstract is preferred over UnixSocketAddressTypeAbstractPadded for new programs. Of course, when connecting to a server created by another process, you must use the appropriate type corresponding to how that process created its listening socket.

Since: 2.26

Properties

abstract

Whether or not this is an abstract address

data UnixSocketAddressAbstractPropertyInfo Source #

Instances

Instances details
AttrInfo UnixSocketAddressAbstractPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

Associated Types

type AttrAllowedOps UnixSocketAddressAbstractPropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrBaseTypeConstraint UnixSocketAddressAbstractPropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrGetType UnixSocketAddressAbstractPropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrSetTypeConstraint UnixSocketAddressAbstractPropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrTransferTypeConstraint UnixSocketAddressAbstractPropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrTransferType UnixSocketAddressAbstractPropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrLabel UnixSocketAddressAbstractPropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrOrigin UnixSocketAddressAbstractPropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrAllowedOps UnixSocketAddressAbstractPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrBaseTypeConstraint UnixSocketAddressAbstractPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrGetType UnixSocketAddressAbstractPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrLabel UnixSocketAddressAbstractPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrOrigin UnixSocketAddressAbstractPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrSetTypeConstraint UnixSocketAddressAbstractPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrTransferType UnixSocketAddressAbstractPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrTransferTypeConstraint UnixSocketAddressAbstractPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

constructUnixSocketAddressAbstract :: (IsUnixSocketAddress o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getUnixSocketAddressAbstract :: (MonadIO m, IsUnixSocketAddress o) => o -> m Bool Source #

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

get unixSocketAddress #abstract

addressType

The type of Unix socket address.

Since: 2.22

data UnixSocketAddressAddressTypePropertyInfo Source #

Instances

Instances details
AttrInfo UnixSocketAddressAddressTypePropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

Associated Types

type AttrAllowedOps UnixSocketAddressAddressTypePropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrBaseTypeConstraint UnixSocketAddressAddressTypePropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrGetType UnixSocketAddressAddressTypePropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrSetTypeConstraint UnixSocketAddressAddressTypePropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrTransferTypeConstraint UnixSocketAddressAddressTypePropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrTransferType UnixSocketAddressAddressTypePropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrLabel UnixSocketAddressAddressTypePropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrOrigin UnixSocketAddressAddressTypePropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrAllowedOps UnixSocketAddressAddressTypePropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrBaseTypeConstraint UnixSocketAddressAddressTypePropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrGetType UnixSocketAddressAddressTypePropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrLabel UnixSocketAddressAddressTypePropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrOrigin UnixSocketAddressAddressTypePropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrSetTypeConstraint UnixSocketAddressAddressTypePropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrTransferType UnixSocketAddressAddressTypePropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrTransferTypeConstraint UnixSocketAddressAddressTypePropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

constructUnixSocketAddressAddressType :: (IsUnixSocketAddress o, MonadIO m) => UnixSocketAddressType -> m (GValueConstruct o) Source #

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

getUnixSocketAddressAddressType :: (MonadIO m, IsUnixSocketAddress o) => o -> m UnixSocketAddressType Source #

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

get unixSocketAddress #addressType

path

Unix socket path.

Since: 2.22

data UnixSocketAddressPathPropertyInfo Source #

Instances

Instances details
AttrInfo UnixSocketAddressPathPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

Associated Types

type AttrAllowedOps UnixSocketAddressPathPropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrBaseTypeConstraint UnixSocketAddressPathPropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrGetType UnixSocketAddressPathPropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrSetTypeConstraint UnixSocketAddressPathPropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrTransferTypeConstraint UnixSocketAddressPathPropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrTransferType UnixSocketAddressPathPropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrLabel UnixSocketAddressPathPropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrOrigin UnixSocketAddressPathPropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrAllowedOps UnixSocketAddressPathPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrBaseTypeConstraint UnixSocketAddressPathPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrGetType UnixSocketAddressPathPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrLabel UnixSocketAddressPathPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrOrigin UnixSocketAddressPathPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrSetTypeConstraint UnixSocketAddressPathPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrTransferType UnixSocketAddressPathPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrTransferTypeConstraint UnixSocketAddressPathPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

constructUnixSocketAddressPath :: (IsUnixSocketAddress o, MonadIO m) => Text -> m (GValueConstruct o) Source #

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

getUnixSocketAddressPath :: (MonadIO m, IsUnixSocketAddress o) => o -> m Text Source #

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

get unixSocketAddress #path

pathAsArray

Unix socket path, as a byte array.

Since: 2.22

data UnixSocketAddressPathAsArrayPropertyInfo Source #

Instances

Instances details
AttrInfo UnixSocketAddressPathAsArrayPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

Associated Types

type AttrAllowedOps UnixSocketAddressPathAsArrayPropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrBaseTypeConstraint UnixSocketAddressPathAsArrayPropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrGetType UnixSocketAddressPathAsArrayPropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrSetTypeConstraint UnixSocketAddressPathAsArrayPropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrTransferTypeConstraint UnixSocketAddressPathAsArrayPropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrTransferType UnixSocketAddressPathAsArrayPropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrLabel UnixSocketAddressPathAsArrayPropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrOrigin UnixSocketAddressPathAsArrayPropertyInfo 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrAllowedOps UnixSocketAddressPathAsArrayPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrBaseTypeConstraint UnixSocketAddressPathAsArrayPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrGetType UnixSocketAddressPathAsArrayPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrLabel UnixSocketAddressPathAsArrayPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrOrigin UnixSocketAddressPathAsArrayPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrSetTypeConstraint UnixSocketAddressPathAsArrayPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrTransferType UnixSocketAddressPathAsArrayPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

type AttrTransferTypeConstraint UnixSocketAddressPathAsArrayPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixSocketAddress

constructUnixSocketAddressPathAsArray :: (IsUnixSocketAddress o, MonadIO m) => ByteString -> m (GValueConstruct o) Source #

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

getUnixSocketAddressPathAsArray :: (MonadIO m, IsUnixSocketAddress o) => o -> m (Maybe ByteString) Source #

Get the value of the “path-as-array” property. When overloading is enabled, this is equivalent to

get unixSocketAddress #pathAsArray