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 |
This SocketControlMessage
contains a UnixFDList
.
It may be sent using socketSendMessage
and received using
socketReceiveMessage
over UNIX sockets (ie: sockets in the
SocketFamilyUnix
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 when using it.
Synopsis
- newtype UnixFDMessage = UnixFDMessage (ManagedPtr UnixFDMessage)
- class (GObject o, IsDescendantOf UnixFDMessage o) => IsUnixFDMessage o
- toUnixFDMessage :: (MonadIO m, IsUnixFDMessage o) => o -> m UnixFDMessage
- unixFDMessageAppendFd :: (HasCallStack, MonadIO m, IsUnixFDMessage a) => a -> Int32 -> m ()
- unixFDMessageGetFdList :: (HasCallStack, MonadIO m, IsUnixFDMessage a) => a -> m UnixFDList
- unixFDMessageNew :: (HasCallStack, MonadIO m) => m UnixFDMessage
- unixFDMessageNewWithFdList :: (HasCallStack, MonadIO m, IsUnixFDList a) => a -> m UnixFDMessage
- unixFDMessageStealFds :: (HasCallStack, MonadIO m, IsUnixFDMessage a) => a -> m [Int32]
- constructUnixFDMessageFdList :: (IsUnixFDMessage o, MonadIO m, IsUnixFDList a) => a -> m (GValueConstruct o)
- getUnixFDMessageFdList :: (MonadIO m, IsUnixFDMessage o) => o -> m UnixFDList
Exported types
newtype UnixFDMessage Source #
Memory-managed wrapper type.
Instances
Eq UnixFDMessage Source # | |
Defined in GI.Gio.Objects.UnixFDMessage (==) :: UnixFDMessage -> UnixFDMessage -> Bool # (/=) :: UnixFDMessage -> UnixFDMessage -> Bool # | |
GObject UnixFDMessage Source # | |
Defined in GI.Gio.Objects.UnixFDMessage | |
ManagedPtrNewtype UnixFDMessage Source # | |
Defined in GI.Gio.Objects.UnixFDMessage | |
TypedObject UnixFDMessage Source # | |
Defined in GI.Gio.Objects.UnixFDMessage | |
HasParentTypes UnixFDMessage Source # | |
Defined in GI.Gio.Objects.UnixFDMessage | |
IsGValue (Maybe UnixFDMessage) Source # | Convert |
Defined in GI.Gio.Objects.UnixFDMessage gvalueGType_ :: IO GType # gvalueSet_ :: Ptr GValue -> Maybe UnixFDMessage -> IO () # gvalueGet_ :: Ptr GValue -> IO (Maybe UnixFDMessage) # | |
type ParentTypes UnixFDMessage Source # | |
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
(GObject o, IsDescendantOf UnixFDMessage o) => IsUnixFDMessage o Source # | |
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
Click to display all available methods, including inherited ones
Methods
appendFd, bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, serialize, stealData, stealFds, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getFdList, getLevel, getMsgType, getProperty, getQdata, getSize.
Setters
appendFd
unixFDMessageAppendFd Source #
:: (HasCallStack, MonadIO m, IsUnixFDMessage a) | |
=> a |
|
-> Int32 |
|
-> m () | (Can throw |
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 #
:: (HasCallStack, MonadIO m, IsUnixFDMessage a) | |
=> a |
|
-> m UnixFDList | Returns: the |
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
:: (HasCallStack, MonadIO m) | |
=> m UnixFDMessage | Returns: a new |
Creates a new UnixFDMessage
containing an empty file descriptor
list.
Since: 2.22
newWithFdList
unixFDMessageNewWithFdList Source #
:: (HasCallStack, MonadIO m, IsUnixFDList a) | |
=> a |
|
-> m UnixFDMessage | Returns: a new |
Creates a new UnixFDMessage
containing list
.
Since: 2.24
stealFds
unixFDMessageStealFds Source #
:: (HasCallStack, MonadIO m, IsUnixFDMessage a) | |
=> a |
|
-> 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
No description available in the introspection data.
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