| Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
| Safe Haskell | None |
| Language | Haskell2010 |
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_ADDRESS_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 when using it.
- newtype UnixFDMessage = UnixFDMessage (ManagedPtr UnixFDMessage)
- class GObject o => IsUnixFDMessage o
- toUnixFDMessage :: IsUnixFDMessage o => o -> IO UnixFDMessage
- noUnixFDMessage :: Maybe UnixFDMessage
- data UnixFDMessageAppendFdMethodInfo
- unixFDMessageAppendFd :: (HasCallStack, MonadIO m, IsUnixFDMessage a) => a -> Int32 -> m ()
- data UnixFDMessageGetFdListMethodInfo
- unixFDMessageGetFdList :: (HasCallStack, MonadIO m, IsUnixFDMessage a) => a -> m UnixFDList
- unixFDMessageNew :: (HasCallStack, MonadIO m) => m UnixFDMessage
- unixFDMessageNewWithFdList :: (HasCallStack, MonadIO m, IsUnixFDList a) => a -> m UnixFDMessage
- data UnixFDMessageStealFdsMethodInfo
- unixFDMessageStealFds :: (HasCallStack, MonadIO m, IsUnixFDMessage a) => a -> m [Int32]
- data UnixFDMessageFdListPropertyInfo
- constructUnixFDMessageFdList :: (IsUnixFDMessage o, IsUnixFDList a) => a -> IO (GValueConstruct o)
- getUnixFDMessageFdList :: (MonadIO m, IsUnixFDMessage o) => o -> m UnixFDList
- unixFDMessageFdList :: AttrLabelProxy "fdList"
Exported types
newtype UnixFDMessage Source #
Constructors
| UnixFDMessage (ManagedPtr UnixFDMessage) |
Instances
| GObject UnixFDMessage Source # | |
| IsObject UnixFDMessage Source # | |
| IsSocketControlMessage UnixFDMessage Source # | |
| IsUnixFDMessage UnixFDMessage Source # | |
| ((~) * info (ResolveUnixFDMessageMethod t UnixFDMessage), MethodInfo * info UnixFDMessage p) => IsLabel t (UnixFDMessage -> p) Source # | |
| ((~) * info (ResolveUnixFDMessageMethod t UnixFDMessage), MethodInfo * info UnixFDMessage p) => IsLabelProxy t (UnixFDMessage -> p) Source # | |
| HasAttributeList * UnixFDMessage Source # | |
| type AttributeList UnixFDMessage Source # | |
| type SignalList UnixFDMessage Source # | |
class GObject o => IsUnixFDMessage o Source #
Instances
toUnixFDMessage :: IsUnixFDMessage o => o -> IO UnixFDMessage Source #
Methods
appendFd
data UnixFDMessageAppendFdMethodInfo Source #
Instances
| ((~) * signature (Int32 -> m ()), MonadIO m, IsUnixFDMessage a) => MethodInfo * UnixFDMessageAppendFdMethodInfo a signature Source # | |
unixFDMessageAppendFd Source #
Arguments
| :: (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
data UnixFDMessageGetFdListMethodInfo Source #
Instances
| ((~) * signature (m UnixFDList), MonadIO m, IsUnixFDMessage a) => MethodInfo * UnixFDMessageGetFdListMethodInfo a signature Source # | |
unixFDMessageGetFdList Source #
Arguments
| :: (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
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m UnixFDMessage | Returns: a new |
Creates a new UnixFDMessage containing an empty file descriptor
list.
Since: 2.22
newWithFdList
unixFDMessageNewWithFdList Source #
Arguments
| :: (HasCallStack, MonadIO m, IsUnixFDList a) | |
| => a |
|
| -> m UnixFDMessage | Returns: a new |
Creates a new UnixFDMessage containing list.
Since: 2.24
stealFds
data UnixFDMessageStealFdsMethodInfo Source #
Instances
| ((~) * signature (m [Int32]), MonadIO m, IsUnixFDMessage a) => MethodInfo * UnixFDMessageStealFdsMethodInfo a signature Source # | |
unixFDMessageStealFds Source #
Arguments
| :: (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
data UnixFDMessageFdListPropertyInfo Source #
Instances
constructUnixFDMessageFdList :: (IsUnixFDMessage o, IsUnixFDList a) => a -> IO (GValueConstruct o) Source #
getUnixFDMessageFdList :: (MonadIO m, IsUnixFDMessage o) => o -> m UnixFDList Source #
unixFDMessageFdList :: AttrLabelProxy "fdList" Source #