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

GI.Gio.Objects.SocketControlMessage

Description

A GSocketControlMessage is a special-purpose utility message that can be sent to or received from a Socket. These types of messages are often called ‘ancillary data’.

The message can represent some sort of special instruction to or information from the socket or can represent a special kind of transfer to the peer (for example, sending a file descriptor over a UNIX socket).

These messages are sent with socketSendMessage and received with socketReceiveMessage.

To extend the set of control message that can be sent, subclass this class and override the get_size, get_level, get_type and serialize methods.

To extend the set of control messages that can be received, subclass this class and implement the deserialize method. Also, make sure your class is registered with the [typegObject.Type] type system before calling socketReceiveMessage to read such a message.

Since: 2.22

Synopsis

Exported types

newtype SocketControlMessage Source #

Memory-managed wrapper type.

Instances

Instances details
Eq SocketControlMessage Source # 
Instance details

Defined in GI.Gio.Objects.SocketControlMessage

GObject SocketControlMessage Source # 
Instance details

Defined in GI.Gio.Objects.SocketControlMessage

ManagedPtrNewtype SocketControlMessage Source # 
Instance details

Defined in GI.Gio.Objects.SocketControlMessage

TypedObject SocketControlMessage Source # 
Instance details

Defined in GI.Gio.Objects.SocketControlMessage

Methods

glibType :: IO GType #

HasParentTypes SocketControlMessage Source # 
Instance details

Defined in GI.Gio.Objects.SocketControlMessage

HasAttributeList SocketControlMessage Source # 
Instance details

Defined in GI.Gio.Objects.SocketControlMessage

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

Defined in GI.Gio.Objects.SocketControlMessage

(info ~ ResolveSocketControlMessageMethod t SocketControlMessage, OverloadedMethodInfo info SocketControlMessage) => IsLabel t (MethodProxy info SocketControlMessage) Source # 
Instance details

Defined in GI.Gio.Objects.SocketControlMessage

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

Defined in GI.Gio.Objects.SocketControlMessage

IsGValue (Maybe SocketControlMessage) Source #

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

Instance details

Defined in GI.Gio.Objects.SocketControlMessage

type AttributeList SocketControlMessage Source # 
Instance details

Defined in GI.Gio.Objects.SocketControlMessage

type ParentTypes SocketControlMessage Source # 
Instance details

Defined in GI.Gio.Objects.SocketControlMessage

type SignalList SocketControlMessage Source # 
Instance details

Defined in GI.Gio.Objects.SocketControlMessage

class (GObject o, IsDescendantOf SocketControlMessage o) => IsSocketControlMessage o Source #

Type class for types which can be safely cast to SocketControlMessage, for instance with toSocketControlMessage.

Instances

Instances details
(GObject o, IsDescendantOf SocketControlMessage o) => IsSocketControlMessage o Source # 
Instance details

Defined in GI.Gio.Objects.SocketControlMessage

toSocketControlMessage :: (MonadIO m, IsSocketControlMessage o) => o -> m SocketControlMessage Source #

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

Methods

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

Equations

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

deserialize

socketControlMessageDeserialize Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Int32

level: a socket level

-> Int32

type: a socket control message type for the given level

-> ByteString

data: pointer to the message data

-> m (Maybe SocketControlMessage)

Returns: the deserialized message or Nothing

Tries to deserialize a socket control message of a given level and type. This will ask all known (to GType) subclasses of SocketControlMessage if they can understand this kind of message and if so deserialize it into a SocketControlMessage.

If there is no implementation for this kind of control message, Nothing will be returned.

Since: 2.22

getLevel

socketControlMessageGetLevel Source #

Arguments

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

message: a SocketControlMessage

-> m Int32

Returns: an integer describing the level

Returns the "level" (i.e. the originating protocol) of the control message. This is often SOL_SOCKET.

Since: 2.22

getMsgType

socketControlMessageGetMsgType Source #

Arguments

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

message: a SocketControlMessage

-> m Int32

Returns: an integer describing the type of control message

Returns the protocol specific type of the control message. For instance, for UNIX fd passing this would be SCM_RIGHTS.

Since: 2.22

getSize

socketControlMessageGetSize Source #

Arguments

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

message: a SocketControlMessage

-> m CSize

Returns: The number of bytes required.

Returns the space required for the control message, not including headers or alignment.

Since: 2.22

serialize

socketControlMessageSerialize Source #

Arguments

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

message: a SocketControlMessage

-> Ptr ()

data: A buffer to write data to

-> m () 

Converts the data in the message to bytes placed in the message.

data is guaranteed to have enough space to fit the size returned by socketControlMessageGetSize on this object.

Since: 2.22