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 |
A WebSocket extension
WebsocketExtension
is the base class for WebSocket extension objects.
Synopsis
- newtype WebsocketExtension = WebsocketExtension (ManagedPtr WebsocketExtension)
- class (GObject o, IsDescendantOf WebsocketExtension o) => IsWebsocketExtension o
- toWebsocketExtension :: (MonadIO m, IsWebsocketExtension o) => o -> m WebsocketExtension
- websocketExtensionConfigure :: (HasCallStack, MonadIO m, IsWebsocketExtension a) => a -> WebsocketConnectionType -> Maybe (Map (Ptr ()) (Ptr ())) -> m ()
- websocketExtensionGetRequestParams :: (HasCallStack, MonadIO m, IsWebsocketExtension a) => a -> m (Maybe Text)
- websocketExtensionGetResponseParams :: (HasCallStack, MonadIO m, IsWebsocketExtension a) => a -> m (Maybe Text)
- websocketExtensionProcessIncomingMessage :: (HasCallStack, MonadIO m, IsWebsocketExtension a) => a -> Word8 -> Bytes -> m (Bytes, Word8)
- websocketExtensionProcessOutgoingMessage :: (HasCallStack, MonadIO m, IsWebsocketExtension a) => a -> Word8 -> Bytes -> m (Bytes, Word8)
Exported types
newtype WebsocketExtension Source #
Memory-managed wrapper type.
WebsocketExtension (ManagedPtr WebsocketExtension) |
Instances
class (GObject o, IsDescendantOf WebsocketExtension o) => IsWebsocketExtension o Source #
Type class for types which can be safely cast to WebsocketExtension
, for instance with toWebsocketExtension
.
Instances
(GObject o, IsDescendantOf WebsocketExtension o) => IsWebsocketExtension o Source # | |
Defined in GI.Soup.Objects.WebsocketExtension |
toWebsocketExtension :: (MonadIO m, IsWebsocketExtension o) => o -> m WebsocketExtension Source #
Cast to WebsocketExtension
, 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
bindProperty, bindPropertyFull, configure, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, processIncomingMessage, processOutgoingMessage, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getProperty, getQdata, getRequestParams, getResponseParams.
Setters
configure
websocketExtensionConfigure Source #
:: (HasCallStack, MonadIO m, IsWebsocketExtension a) | |
=> a |
|
-> WebsocketConnectionType |
|
-> Maybe (Map (Ptr ()) (Ptr ())) |
|
-> m () | (Can throw |
Configures extension
with the given params
.
getRequestParams
websocketExtensionGetRequestParams Source #
:: (HasCallStack, MonadIO m, IsWebsocketExtension a) | |
=> a |
|
-> m (Maybe Text) | Returns: a new allocated string with the parameters |
Get the parameters strings to be included in the request header.
If the extension doesn't include any parameter in the request, this function
returns Nothing
.
getResponseParams
websocketExtensionGetResponseParams Source #
:: (HasCallStack, MonadIO m, IsWebsocketExtension a) | |
=> a |
|
-> m (Maybe Text) | Returns: a new allocated string with the parameters |
Get the parameters strings to be included in the response header.
If the extension doesn't include any parameter in the response, this function
returns Nothing
.
processIncomingMessage
websocketExtensionProcessIncomingMessage Source #
:: (HasCallStack, MonadIO m, IsWebsocketExtension a) | |
=> a |
|
-> Word8 |
|
-> Bytes |
|
-> m (Bytes, Word8) | Returns: the message payload data, or |
Process a message after it's received.
If the payload isn't changed the given payload
is just returned, otherwise
bytesUnref
is called on the given payload
and a new
[structgLib
.Bytes] is returned with the new data.
Extensions using reserved bits of the header will reset them in header
.
processOutgoingMessage
websocketExtensionProcessOutgoingMessage Source #
:: (HasCallStack, MonadIO m, IsWebsocketExtension a) | |
=> a |
|
-> Word8 |
|
-> Bytes |
|
-> m (Bytes, Word8) | Returns: the message payload data, or |
Process a message before it's sent.
If the payload isn't changed the given payload
is just returned, otherwise
Glib.Bytes.unref()
is called on the given payload
and a new
[structgLib
.Bytes] is returned with the new data.
Extensions using reserved bits of the header will change them in header
.