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

GI.Gio.Objects.UnixFDMessage

Description

This SocketControlMessage contains a UnixFDList. It may be sent using socketSendMessage and received using socketReceiveMessage over UNIX sockets (ie: sockets in the G_SOCKET_FAMILY_UNIX family). The file descriptors are copied between processes by the kernel.

For an easier way to send and receive file descriptors over stream-oriented UNIX sockets, see unixConnectionSendFd and unixConnectionReceiveFd.

Note that <gio/gunixfdmessage.h> belongs to the UNIX-specific GIO interfaces, thus you have to use the gio-unix-2.0.pc pkg-config file or the GioUnix-2.0 GIR namespace when using it.

Synopsis

Exported types

newtype UnixFDMessage Source #

Memory-managed wrapper type.

Instances

Instances details
Eq UnixFDMessage Source # 
Instance details

Defined in GI.Gio.Objects.UnixFDMessage

GObject UnixFDMessage Source # 
Instance details

Defined in GI.Gio.Objects.UnixFDMessage

ManagedPtrNewtype UnixFDMessage Source # 
Instance details

Defined in GI.Gio.Objects.UnixFDMessage

TypedObject UnixFDMessage Source # 
Instance details

Defined in GI.Gio.Objects.UnixFDMessage

Methods

glibType :: IO GType #

HasParentTypes UnixFDMessage Source # 
Instance details

Defined in GI.Gio.Objects.UnixFDMessage

HasAttributeList UnixFDMessage Source # 
Instance details

Defined in GI.Gio.Objects.UnixFDMessage

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

Defined in GI.Gio.Objects.UnixFDMessage

Methods

getField :: UnixFDMessage -> p #

(info ~ ResolveUnixFDMessageMethod t UnixFDMessage, OverloadedMethodInfo info UnixFDMessage) => IsLabel t (MethodProxy info UnixFDMessage) Source # 
Instance details

Defined in GI.Gio.Objects.UnixFDMessage

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

Defined in GI.Gio.Objects.UnixFDMessage

Methods

fromLabel :: UnixFDMessage -> p #

IsGValue (Maybe UnixFDMessage) Source #

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

Instance details

Defined in GI.Gio.Objects.UnixFDMessage

type AttributeList UnixFDMessage Source # 
Instance details

Defined in GI.Gio.Objects.UnixFDMessage

type ParentTypes UnixFDMessage Source # 
Instance details

Defined in GI.Gio.Objects.UnixFDMessage

type SignalList UnixFDMessage Source # 
Instance details

Defined in GI.Gio.Objects.UnixFDMessage

class (GObject o, IsDescendantOf UnixFDMessage o) => IsUnixFDMessage o Source #

Type class for types which can be safely cast to UnixFDMessage, for instance with toUnixFDMessage.

Instances

Instances details
(GObject o, IsDescendantOf UnixFDMessage o) => IsUnixFDMessage o Source # 
Instance details

Defined in GI.Gio.Objects.UnixFDMessage

toUnixFDMessage :: (MonadIO m, IsUnixFDMessage o) => o -> m UnixFDMessage Source #

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

Methods

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

Equations

ResolveUnixFDMessageMethod "appendFd" o = UnixFDMessageAppendFdMethodInfo 
ResolveUnixFDMessageMethod "bindProperty" o = ObjectBindPropertyMethodInfo 
ResolveUnixFDMessageMethod "bindPropertyFull" o = ObjectBindPropertyFullMethodInfo 
ResolveUnixFDMessageMethod "forceFloating" o = ObjectForceFloatingMethodInfo 
ResolveUnixFDMessageMethod "freezeNotify" o = ObjectFreezeNotifyMethodInfo 
ResolveUnixFDMessageMethod "getv" o = ObjectGetvMethodInfo 
ResolveUnixFDMessageMethod "isFloating" o = ObjectIsFloatingMethodInfo 
ResolveUnixFDMessageMethod "notify" o = ObjectNotifyMethodInfo 
ResolveUnixFDMessageMethod "notifyByPspec" o = ObjectNotifyByPspecMethodInfo 
ResolveUnixFDMessageMethod "ref" o = ObjectRefMethodInfo 
ResolveUnixFDMessageMethod "refSink" o = ObjectRefSinkMethodInfo 
ResolveUnixFDMessageMethod "runDispose" o = ObjectRunDisposeMethodInfo 
ResolveUnixFDMessageMethod "serialize" o = SocketControlMessageSerializeMethodInfo 
ResolveUnixFDMessageMethod "stealData" o = ObjectStealDataMethodInfo 
ResolveUnixFDMessageMethod "stealFds" o = UnixFDMessageStealFdsMethodInfo 
ResolveUnixFDMessageMethod "stealQdata" o = ObjectStealQdataMethodInfo 
ResolveUnixFDMessageMethod "thawNotify" o = ObjectThawNotifyMethodInfo 
ResolveUnixFDMessageMethod "unref" o = ObjectUnrefMethodInfo 
ResolveUnixFDMessageMethod "watchClosure" o = ObjectWatchClosureMethodInfo 
ResolveUnixFDMessageMethod "getData" o = ObjectGetDataMethodInfo 
ResolveUnixFDMessageMethod "getFdList" o = UnixFDMessageGetFdListMethodInfo 
ResolveUnixFDMessageMethod "getLevel" o = SocketControlMessageGetLevelMethodInfo 
ResolveUnixFDMessageMethod "getMsgType" o = SocketControlMessageGetMsgTypeMethodInfo 
ResolveUnixFDMessageMethod "getProperty" o = ObjectGetPropertyMethodInfo 
ResolveUnixFDMessageMethod "getQdata" o = ObjectGetQdataMethodInfo 
ResolveUnixFDMessageMethod "getSize" o = SocketControlMessageGetSizeMethodInfo 
ResolveUnixFDMessageMethod "setData" o = ObjectSetDataMethodInfo 
ResolveUnixFDMessageMethod "setDataFull" o = ObjectSetDataFullMethodInfo 
ResolveUnixFDMessageMethod "setProperty" o = ObjectSetPropertyMethodInfo 
ResolveUnixFDMessageMethod l o = MethodResolutionFailed l o :: Type 

appendFd

unixFDMessageAppendFd Source #

Arguments

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

message: a UnixFDMessage

-> Int32

fd: a valid open file descriptor

-> m ()

(Can throw GError)

Adds a file descriptor to message.

The file descriptor is duplicated using dup(). You keep your copy of the descriptor and the copy contained in message will be closed when message is finalized.

A possible cause of failure is exceeding the per-process or system-wide file descriptor limit.

Since: 2.22

getFdList

unixFDMessageGetFdList Source #

Arguments

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

message: a UnixFDMessage

-> m UnixFDList

Returns: the UnixFDList from message

Gets the UnixFDList contained in message. This function does not return a reference to the caller, but the returned list is valid for the lifetime of message.

Since: 2.24

new

unixFDMessageNew Source #

Arguments

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

Returns: a new UnixFDMessage

Creates a new UnixFDMessage containing an empty file descriptor list.

Since: 2.22

newWithFdList

unixFDMessageNewWithFdList Source #

Arguments

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

fdList: a UnixFDList

-> m UnixFDMessage

Returns: a new UnixFDMessage

Creates a new UnixFDMessage containing list.

Since: 2.24

stealFds

unixFDMessageStealFds Source #

Arguments

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

message: a UnixFDMessage

-> m [Int32]

Returns: an array of file descriptors

Returns the array of file descriptors that is contained in this object.

After this call, the descriptors are no longer contained in message. Further calls will return an empty list (unless more descriptors have been added).

The return result of this function must be freed with free. The caller is also responsible for closing all of the file descriptors.

If length is non-Nothing then it is set to the number of file descriptors in the returned array. The returned array is also terminated with -1.

This function never returns Nothing. In case there are no file descriptors contained in message, an empty array is returned.

Since: 2.22

Properties

fdList

The UnixFDList object to send with the message.

Since: 2.22

data UnixFDMessageFdListPropertyInfo Source #

Instances

Instances details
AttrInfo UnixFDMessageFdListPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixFDMessage

type AttrAllowedOps UnixFDMessageFdListPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixFDMessage

type AttrBaseTypeConstraint UnixFDMessageFdListPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixFDMessage

type AttrGetType UnixFDMessageFdListPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixFDMessage

type AttrLabel UnixFDMessageFdListPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixFDMessage

type AttrOrigin UnixFDMessageFdListPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixFDMessage

type AttrSetTypeConstraint UnixFDMessageFdListPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixFDMessage

type AttrTransferType UnixFDMessageFdListPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixFDMessage

type AttrTransferTypeConstraint UnixFDMessageFdListPropertyInfo Source # 
Instance details

Defined in GI.Gio.Objects.UnixFDMessage

constructUnixFDMessageFdList :: (IsUnixFDMessage o, MonadIO m, IsUnixFDList a) => a -> m (GValueConstruct o) Source #

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

getUnixFDMessageFdList :: (MonadIO m, IsUnixFDMessage o) => o -> m UnixFDList Source #

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

get unixFDMessage #fdList