gi-soup-2.4.25: Libsoup bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Soup.Objects.WebsocketExtension

Description

No description available in the introspection data.

Synopsis

Exported types

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

Instances details
(GObject o, IsDescendantOf WebsocketExtension o) => IsWebsocketExtension o Source # 
Instance details

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

configure

websocketExtensionConfigure Source #

Arguments

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

extension: a WebsocketExtension

-> WebsocketConnectionType

connectionType: either WebsocketConnectionTypeClient or WebsocketConnectionTypeServer

-> Maybe (Map (Ptr ()) (Ptr ()))

params: the parameters, or Nothing

-> m ()

(Can throw GError)

Configures extension with the given params

getRequestParams

websocketExtensionGetRequestParams Source #

Arguments

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

extension: a WebsocketExtension

-> 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.

Since: 2.68

getResponseParams

websocketExtensionGetResponseParams Source #

Arguments

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

extension: a WebsocketExtension

-> 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.

Since: 2.68

processIncomingMessage

websocketExtensionProcessIncomingMessage Source #

Arguments

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

extension: a WebsocketExtension

-> Word8

header: the message header

-> Bytes

payload: the payload data

-> m (Bytes, Word8)

Returns: the message payload data, or Nothing in case of error (Can throw GError)

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 Bytes is returned with the new data.

Extensions using reserved bits of the header will reset them in header.

Since: 2.68

processOutgoingMessage

websocketExtensionProcessOutgoingMessage Source #

Arguments

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

extension: a WebsocketExtension

-> Word8

header: the message header

-> Bytes

payload: the payload data

-> m (Bytes, Word8)

Returns: the message payload data, or Nothing in case of error (Can throw GError)

Process a message before it's sent. If the payload isn't changed the given payload is just returned, otherwise bytesUnref is called on the given payload and a new Bytes is returned with the new data.

Extensions using reserved bits of the header will change them in header.

Since: 2.68