Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
A class representing a WebSocket connection.
Since: 2.50
Synopsis
- newtype WebsocketConnection = WebsocketConnection (ManagedPtr WebsocketConnection)
- class (GObject o, IsDescendantOf WebsocketConnection o) => IsWebsocketConnection o
- toWebsocketConnection :: (MonadIO m, IsWebsocketConnection o) => o -> m WebsocketConnection
- noWebsocketConnection :: Maybe WebsocketConnection
- websocketConnectionClose :: (HasCallStack, MonadIO m, IsWebsocketConnection a) => a -> Word16 -> Maybe Text -> m ()
- websocketConnectionGetCloseCode :: (HasCallStack, MonadIO m, IsWebsocketConnection a) => a -> m Word16
- websocketConnectionGetCloseData :: (HasCallStack, MonadIO m, IsWebsocketConnection a) => a -> m Text
- websocketConnectionGetConnectionType :: (HasCallStack, MonadIO m, IsWebsocketConnection a) => a -> m WebsocketConnectionType
- websocketConnectionGetIoStream :: (HasCallStack, MonadIO m, IsWebsocketConnection a) => a -> m IOStream
- websocketConnectionGetKeepaliveInterval :: (HasCallStack, MonadIO m, IsWebsocketConnection a) => a -> m Word32
- websocketConnectionGetMaxIncomingPayloadSize :: (HasCallStack, MonadIO m, IsWebsocketConnection a) => a -> m Word64
- websocketConnectionGetOrigin :: (HasCallStack, MonadIO m, IsWebsocketConnection a) => a -> m (Maybe Text)
- websocketConnectionGetProtocol :: (HasCallStack, MonadIO m, IsWebsocketConnection a) => a -> m (Maybe Text)
- websocketConnectionGetState :: (HasCallStack, MonadIO m, IsWebsocketConnection a) => a -> m WebsocketState
- websocketConnectionGetUri :: (HasCallStack, MonadIO m, IsWebsocketConnection a) => a -> m URI
- websocketConnectionNew :: (HasCallStack, MonadIO m, IsIOStream a) => a -> URI -> WebsocketConnectionType -> Maybe Text -> Maybe Text -> m WebsocketConnection
- websocketConnectionSendBinary :: (HasCallStack, MonadIO m, IsWebsocketConnection a) => a -> ByteString -> m ()
- websocketConnectionSendText :: (HasCallStack, MonadIO m, IsWebsocketConnection a) => a -> Text -> m ()
- websocketConnectionSetKeepaliveInterval :: (HasCallStack, MonadIO m, IsWebsocketConnection a) => a -> Word32 -> m ()
- websocketConnectionSetMaxIncomingPayloadSize :: (HasCallStack, MonadIO m, IsWebsocketConnection a) => a -> Word64 -> m ()
- constructWebsocketConnectionConnectionType :: IsWebsocketConnection o => WebsocketConnectionType -> IO (GValueConstruct o)
- getWebsocketConnectionConnectionType :: (MonadIO m, IsWebsocketConnection o) => o -> m WebsocketConnectionType
- constructWebsocketConnectionIoStream :: (IsWebsocketConnection o, IsIOStream a) => a -> IO (GValueConstruct o)
- getWebsocketConnectionIoStream :: (MonadIO m, IsWebsocketConnection o) => o -> m IOStream
- constructWebsocketConnectionKeepaliveInterval :: IsWebsocketConnection o => Word32 -> IO (GValueConstruct o)
- getWebsocketConnectionKeepaliveInterval :: (MonadIO m, IsWebsocketConnection o) => o -> m Word32
- setWebsocketConnectionKeepaliveInterval :: (MonadIO m, IsWebsocketConnection o) => o -> Word32 -> m ()
- constructWebsocketConnectionMaxIncomingPayloadSize :: IsWebsocketConnection o => Word64 -> IO (GValueConstruct o)
- getWebsocketConnectionMaxIncomingPayloadSize :: (MonadIO m, IsWebsocketConnection o) => o -> m Word64
- setWebsocketConnectionMaxIncomingPayloadSize :: (MonadIO m, IsWebsocketConnection o) => o -> Word64 -> m ()
- constructWebsocketConnectionOrigin :: IsWebsocketConnection o => Text -> IO (GValueConstruct o)
- getWebsocketConnectionOrigin :: (MonadIO m, IsWebsocketConnection o) => o -> m (Maybe Text)
- constructWebsocketConnectionProtocol :: IsWebsocketConnection o => Text -> IO (GValueConstruct o)
- getWebsocketConnectionProtocol :: (MonadIO m, IsWebsocketConnection o) => o -> m (Maybe Text)
- getWebsocketConnectionState :: (MonadIO m, IsWebsocketConnection o) => o -> m WebsocketState
- constructWebsocketConnectionUri :: IsWebsocketConnection o => URI -> IO (GValueConstruct o)
- getWebsocketConnectionUri :: (MonadIO m, IsWebsocketConnection o) => o -> m URI
- type C_WebsocketConnectionClosedCallback = Ptr () -> Ptr () -> IO ()
- type WebsocketConnectionClosedCallback = IO ()
- afterWebsocketConnectionClosed :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionClosedCallback -> m SignalHandlerId
- genClosure_WebsocketConnectionClosed :: MonadIO m => WebsocketConnectionClosedCallback -> m (GClosure C_WebsocketConnectionClosedCallback)
- mk_WebsocketConnectionClosedCallback :: C_WebsocketConnectionClosedCallback -> IO (FunPtr C_WebsocketConnectionClosedCallback)
- noWebsocketConnectionClosedCallback :: Maybe WebsocketConnectionClosedCallback
- onWebsocketConnectionClosed :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionClosedCallback -> m SignalHandlerId
- wrap_WebsocketConnectionClosedCallback :: WebsocketConnectionClosedCallback -> C_WebsocketConnectionClosedCallback
- type C_WebsocketConnectionClosingCallback = Ptr () -> Ptr () -> IO ()
- type WebsocketConnectionClosingCallback = IO ()
- afterWebsocketConnectionClosing :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionClosingCallback -> m SignalHandlerId
- genClosure_WebsocketConnectionClosing :: MonadIO m => WebsocketConnectionClosingCallback -> m (GClosure C_WebsocketConnectionClosingCallback)
- mk_WebsocketConnectionClosingCallback :: C_WebsocketConnectionClosingCallback -> IO (FunPtr C_WebsocketConnectionClosingCallback)
- noWebsocketConnectionClosingCallback :: Maybe WebsocketConnectionClosingCallback
- onWebsocketConnectionClosing :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionClosingCallback -> m SignalHandlerId
- wrap_WebsocketConnectionClosingCallback :: WebsocketConnectionClosingCallback -> C_WebsocketConnectionClosingCallback
- type C_WebsocketConnectionErrorCallback = Ptr () -> Ptr GError -> Ptr () -> IO ()
- type WebsocketConnectionErrorCallback = GError -> IO ()
- afterWebsocketConnectionError :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionErrorCallback -> m SignalHandlerId
- genClosure_WebsocketConnectionError :: MonadIO m => WebsocketConnectionErrorCallback -> m (GClosure C_WebsocketConnectionErrorCallback)
- mk_WebsocketConnectionErrorCallback :: C_WebsocketConnectionErrorCallback -> IO (FunPtr C_WebsocketConnectionErrorCallback)
- noWebsocketConnectionErrorCallback :: Maybe WebsocketConnectionErrorCallback
- onWebsocketConnectionError :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionErrorCallback -> m SignalHandlerId
- wrap_WebsocketConnectionErrorCallback :: WebsocketConnectionErrorCallback -> C_WebsocketConnectionErrorCallback
- type C_WebsocketConnectionMessageCallback = Ptr () -> Int32 -> Ptr Bytes -> Ptr () -> IO ()
- type WebsocketConnectionMessageCallback = Int32 -> Bytes -> IO ()
- afterWebsocketConnectionMessage :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionMessageCallback -> m SignalHandlerId
- genClosure_WebsocketConnectionMessage :: MonadIO m => WebsocketConnectionMessageCallback -> m (GClosure C_WebsocketConnectionMessageCallback)
- mk_WebsocketConnectionMessageCallback :: C_WebsocketConnectionMessageCallback -> IO (FunPtr C_WebsocketConnectionMessageCallback)
- noWebsocketConnectionMessageCallback :: Maybe WebsocketConnectionMessageCallback
- onWebsocketConnectionMessage :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionMessageCallback -> m SignalHandlerId
- wrap_WebsocketConnectionMessageCallback :: WebsocketConnectionMessageCallback -> C_WebsocketConnectionMessageCallback
- type C_WebsocketConnectionPongCallback = Ptr () -> Ptr Bytes -> Ptr () -> IO ()
- type WebsocketConnectionPongCallback = Bytes -> IO ()
- afterWebsocketConnectionPong :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionPongCallback -> m SignalHandlerId
- genClosure_WebsocketConnectionPong :: MonadIO m => WebsocketConnectionPongCallback -> m (GClosure C_WebsocketConnectionPongCallback)
- mk_WebsocketConnectionPongCallback :: C_WebsocketConnectionPongCallback -> IO (FunPtr C_WebsocketConnectionPongCallback)
- noWebsocketConnectionPongCallback :: Maybe WebsocketConnectionPongCallback
- onWebsocketConnectionPong :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionPongCallback -> m SignalHandlerId
- wrap_WebsocketConnectionPongCallback :: WebsocketConnectionPongCallback -> C_WebsocketConnectionPongCallback
Exported types
newtype WebsocketConnection Source #
Memory-managed wrapper type.
Instances
Eq WebsocketConnection Source # | |
Defined in GI.Soup.Objects.WebsocketConnection (==) :: WebsocketConnection -> WebsocketConnection -> Bool # (/=) :: WebsocketConnection -> WebsocketConnection -> Bool # | |
IsGValue WebsocketConnection Source # | Convert |
Defined in GI.Soup.Objects.WebsocketConnection toGValue :: WebsocketConnection -> IO GValue # fromGValue :: GValue -> IO WebsocketConnection # | |
GObject WebsocketConnection Source # | |
Defined in GI.Soup.Objects.WebsocketConnection gobjectType :: IO GType # | |
HasParentTypes WebsocketConnection Source # | |
Defined in GI.Soup.Objects.WebsocketConnection | |
type ParentTypes WebsocketConnection Source # | |
Defined in GI.Soup.Objects.WebsocketConnection |
class (GObject o, IsDescendantOf WebsocketConnection o) => IsWebsocketConnection o Source #
Type class for types which can be safely cast to WebsocketConnection
, for instance with toWebsocketConnection
.
Instances
(GObject o, IsDescendantOf WebsocketConnection o) => IsWebsocketConnection o Source # | |
Defined in GI.Soup.Objects.WebsocketConnection |
toWebsocketConnection :: (MonadIO m, IsWebsocketConnection o) => o -> m WebsocketConnection Source #
Cast to WebsocketConnection
, for types for which this is known to be safe. For general casts, use castTo
.
noWebsocketConnection :: Maybe WebsocketConnection Source #
A convenience alias for Nothing
:: Maybe
WebsocketConnection
.
Methods
Overloaded methods
close
websocketConnectionClose Source #
:: (HasCallStack, MonadIO m, IsWebsocketConnection a) | |
=> a |
|
-> Word16 |
|
-> Maybe Text |
|
-> m () |
Close the connection in an orderly fashion.
Note that until the closed signal fires, the connection is not yet completely closed. The close message is not even sent until the main loop runs.
The code
and data
are sent to the peer along with the close request.
Note that the data
must be UTF-8 valid.
Since: 2.50
getCloseCode
websocketConnectionGetCloseCode Source #
:: (HasCallStack, MonadIO m, IsWebsocketConnection a) | |
=> a |
|
-> m Word16 | Returns: the close code or zero. |
Get the close code received from the WebSocket peer.
This only becomes valid once the WebSocket is in the
WebsocketStateClosed
state. The value will often be in the
WebsocketCloseCode
enumeration, but may also be an application
defined close code.
Since: 2.50
getCloseData
websocketConnectionGetCloseData Source #
:: (HasCallStack, MonadIO m, IsWebsocketConnection a) | |
=> a |
|
-> m Text | Returns: the close data or |
Get the close data received from the WebSocket peer.
This only becomes valid once the WebSocket is in the
WebsocketStateClosed
state. The data may be freed once
the main loop is run, so copy it if you need to keep it around.
Since: 2.50
getConnectionType
websocketConnectionGetConnectionType Source #
:: (HasCallStack, MonadIO m, IsWebsocketConnection a) | |
=> a |
|
-> m WebsocketConnectionType | Returns: the connection type |
Get the connection type (client/server) of the connection.
Since: 2.50
getIoStream
websocketConnectionGetIoStream Source #
:: (HasCallStack, MonadIO m, IsWebsocketConnection a) | |
=> a |
|
-> m IOStream | Returns: the WebSocket's I/O stream. |
Get the I/O stream the WebSocket is communicating over.
Since: 2.50
getKeepaliveInterval
websocketConnectionGetKeepaliveInterval Source #
:: (HasCallStack, MonadIO m, IsWebsocketConnection a) | |
=> a |
|
-> m Word32 | Returns: the keepalive interval. |
Gets the keepalive interval in seconds or 0 if disabled.
Since: 2.58
getMaxIncomingPayloadSize
websocketConnectionGetMaxIncomingPayloadSize Source #
:: (HasCallStack, MonadIO m, IsWebsocketConnection a) | |
=> a |
|
-> m Word64 | Returns: the maximum payload size. |
Gets the maximum payload size allowed for incoming packets.
Since: 2.56
getOrigin
websocketConnectionGetOrigin Source #
:: (HasCallStack, MonadIO m, IsWebsocketConnection a) | |
=> a |
|
-> m (Maybe Text) | Returns: the origin, or |
Get the origin of the WebSocket.
Since: 2.50
getProtocol
websocketConnectionGetProtocol Source #
:: (HasCallStack, MonadIO m, IsWebsocketConnection a) | |
=> a |
|
-> m (Maybe Text) | Returns: the chosen protocol, or |
Get the protocol chosen via negotiation with the peer.
Since: 2.50
getState
websocketConnectionGetState Source #
:: (HasCallStack, MonadIO m, IsWebsocketConnection a) | |
=> a |
|
-> m WebsocketState | Returns: the state |
Get the current state of the WebSocket.
Since: 2.50
getUri
websocketConnectionGetUri Source #
:: (HasCallStack, MonadIO m, IsWebsocketConnection a) | |
=> a |
|
-> m URI | Returns: the URI |
Get the URI of the WebSocket.
For servers this represents the address of the WebSocket, and for clients it is the address connected to.
Since: 2.50
new
websocketConnectionNew Source #
:: (HasCallStack, MonadIO m, IsIOStream a) | |
=> a |
|
-> URI |
|
-> WebsocketConnectionType |
|
-> Maybe Text |
|
-> Maybe Text |
|
-> m WebsocketConnection | Returns: a new |
Creates a WebsocketConnection
on stream
. This should be
called after completing the handshake to begin using the WebSocket
protocol.
Since: 2.50
sendBinary
websocketConnectionSendBinary Source #
:: (HasCallStack, MonadIO m, IsWebsocketConnection a) | |
=> a |
|
-> ByteString |
|
-> m () |
Send a binary message to the peer.
The message is queued to be sent and will be sent when the main loop is run.
Since: 2.50
sendText
websocketConnectionSendText Source #
:: (HasCallStack, MonadIO m, IsWebsocketConnection a) | |
=> a |
|
-> Text |
|
-> m () |
Send a text (UTF-8) message to the peer.
The message is queued to be sent and will be sent when the main loop is run.
Since: 2.50
setKeepaliveInterval
websocketConnectionSetKeepaliveInterval Source #
:: (HasCallStack, MonadIO m, IsWebsocketConnection a) | |
=> a |
|
-> Word32 |
|
-> m () |
Sets the interval in seconds on when to send a ping message which will serve as a keepalive message. If set to 0 the keepalive message is disabled.
Since: 2.58
setMaxIncomingPayloadSize
websocketConnectionSetMaxIncomingPayloadSize Source #
:: (HasCallStack, MonadIO m, IsWebsocketConnection a) | |
=> a |
|
-> Word64 |
|
-> m () |
Sets the maximum payload size allowed for incoming packets. It does not limit the outgoing packet size.
Since: 2.56
Properties
connectionType
The type of connection (client/server).
Since: 2.50
constructWebsocketConnectionConnectionType :: IsWebsocketConnection o => WebsocketConnectionType -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “connection-type
” property. This is rarely needed directly, but it is used by new
.
getWebsocketConnectionConnectionType :: (MonadIO m, IsWebsocketConnection o) => o -> m WebsocketConnectionType Source #
Get the value of the “connection-type
” property.
When overloading is enabled, this is equivalent to
get
websocketConnection #connectionType
ioStream
The underlying IO stream the WebSocket is communicating over.
The input and output streams must be pollable streams.
Since: 2.50
constructWebsocketConnectionIoStream :: (IsWebsocketConnection o, IsIOStream a) => a -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “io-stream
” property. This is rarely needed directly, but it is used by new
.
getWebsocketConnectionIoStream :: (MonadIO m, IsWebsocketConnection o) => o -> m IOStream Source #
Get the value of the “io-stream
” property.
When overloading is enabled, this is equivalent to
get
websocketConnection #ioStream
keepaliveInterval
Interval in seconds on when to send a ping message which will serve as a keepalive message. If set to 0 the keepalive message is disabled.
Since: 2.58
constructWebsocketConnectionKeepaliveInterval :: IsWebsocketConnection o => Word32 -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “keepalive-interval
” property. This is rarely needed directly, but it is used by new
.
getWebsocketConnectionKeepaliveInterval :: (MonadIO m, IsWebsocketConnection o) => o -> m Word32 Source #
Get the value of the “keepalive-interval
” property.
When overloading is enabled, this is equivalent to
get
websocketConnection #keepaliveInterval
setWebsocketConnectionKeepaliveInterval :: (MonadIO m, IsWebsocketConnection o) => o -> Word32 -> m () Source #
Set the value of the “keepalive-interval
” property.
When overloading is enabled, this is equivalent to
set
websocketConnection [ #keepaliveInterval:=
value ]
maxIncomingPayloadSize
The maximum payload size for incoming packets the protocol expects or 0 to not limit it.
Since: 2.56
constructWebsocketConnectionMaxIncomingPayloadSize :: IsWebsocketConnection o => Word64 -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “max-incoming-payload-size
” property. This is rarely needed directly, but it is used by new
.
getWebsocketConnectionMaxIncomingPayloadSize :: (MonadIO m, IsWebsocketConnection o) => o -> m Word64 Source #
Get the value of the “max-incoming-payload-size
” property.
When overloading is enabled, this is equivalent to
get
websocketConnection #maxIncomingPayloadSize
setWebsocketConnectionMaxIncomingPayloadSize :: (MonadIO m, IsWebsocketConnection o) => o -> Word64 -> m () Source #
Set the value of the “max-incoming-payload-size
” property.
When overloading is enabled, this is equivalent to
set
websocketConnection [ #maxIncomingPayloadSize:=
value ]
origin
The client's Origin.
Since: 2.50
constructWebsocketConnectionOrigin :: IsWebsocketConnection o => Text -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “origin
” property. This is rarely needed directly, but it is used by new
.
getWebsocketConnectionOrigin :: (MonadIO m, IsWebsocketConnection o) => o -> m (Maybe Text) Source #
Get the value of the “origin
” property.
When overloading is enabled, this is equivalent to
get
websocketConnection #origin
protocol
The chosen protocol, or Nothing
if a protocol was not agreed
upon.
Since: 2.50
constructWebsocketConnectionProtocol :: IsWebsocketConnection o => Text -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “protocol
” property. This is rarely needed directly, but it is used by new
.
getWebsocketConnectionProtocol :: (MonadIO m, IsWebsocketConnection o) => o -> m (Maybe Text) Source #
Get the value of the “protocol
” property.
When overloading is enabled, this is equivalent to
get
websocketConnection #protocol
state
The current state of the WebSocket.
Since: 2.50
getWebsocketConnectionState :: (MonadIO m, IsWebsocketConnection o) => o -> m WebsocketState Source #
Get the value of the “state
” property.
When overloading is enabled, this is equivalent to
get
websocketConnection #state
uri
The URI of the WebSocket.
For servers this represents the address of the WebSocket, and for clients it is the address connected to.
Since: 2.50
constructWebsocketConnectionUri :: IsWebsocketConnection o => URI -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “uri
” property. This is rarely needed directly, but it is used by new
.
getWebsocketConnectionUri :: (MonadIO m, IsWebsocketConnection o) => o -> m URI Source #
Get the value of the “uri
” property.
When overloading is enabled, this is equivalent to
get
websocketConnection #uri
Signals
closed
type C_WebsocketConnectionClosedCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type WebsocketConnectionClosedCallback = IO () Source #
Emitted when the connection has completely closed, either
due to an orderly close from the peer, one initiated via
websocketConnectionClose
or a fatal error
condition that caused a close.
This signal will be emitted once.
Since: 2.50
afterWebsocketConnectionClosed :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionClosedCallback -> m SignalHandlerId Source #
Connect a signal handler for the closed signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
websocketConnection #closed callback
genClosure_WebsocketConnectionClosed :: MonadIO m => WebsocketConnectionClosedCallback -> m (GClosure C_WebsocketConnectionClosedCallback) Source #
Wrap the callback into a GClosure
.
mk_WebsocketConnectionClosedCallback :: C_WebsocketConnectionClosedCallback -> IO (FunPtr C_WebsocketConnectionClosedCallback) Source #
Generate a function pointer callable from C code, from a C_WebsocketConnectionClosedCallback
.
noWebsocketConnectionClosedCallback :: Maybe WebsocketConnectionClosedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
WebsocketConnectionClosedCallback
onWebsocketConnectionClosed :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionClosedCallback -> m SignalHandlerId Source #
Connect a signal handler for the closed signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
websocketConnection #closed callback
wrap_WebsocketConnectionClosedCallback :: WebsocketConnectionClosedCallback -> C_WebsocketConnectionClosedCallback Source #
closing
type C_WebsocketConnectionClosingCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type WebsocketConnectionClosingCallback = IO () Source #
This signal will be emitted during an orderly close.
Since: 2.50
afterWebsocketConnectionClosing :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionClosingCallback -> m SignalHandlerId Source #
Connect a signal handler for the closing signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
websocketConnection #closing callback
genClosure_WebsocketConnectionClosing :: MonadIO m => WebsocketConnectionClosingCallback -> m (GClosure C_WebsocketConnectionClosingCallback) Source #
Wrap the callback into a GClosure
.
mk_WebsocketConnectionClosingCallback :: C_WebsocketConnectionClosingCallback -> IO (FunPtr C_WebsocketConnectionClosingCallback) Source #
Generate a function pointer callable from C code, from a C_WebsocketConnectionClosingCallback
.
noWebsocketConnectionClosingCallback :: Maybe WebsocketConnectionClosingCallback Source #
A convenience synonym for
.Nothing
:: Maybe
WebsocketConnectionClosingCallback
onWebsocketConnectionClosing :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionClosingCallback -> m SignalHandlerId Source #
Connect a signal handler for the closing signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
websocketConnection #closing callback
wrap_WebsocketConnectionClosingCallback :: WebsocketConnectionClosingCallback -> C_WebsocketConnectionClosingCallback Source #
error
type C_WebsocketConnectionErrorCallback = Ptr () -> Ptr GError -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type WebsocketConnectionErrorCallback Source #
Emitted when an error occurred on the WebSocket. This may be fired multiple times. Fatal errors will be followed by the closed signal being emitted.
Since: 2.50
afterWebsocketConnectionError :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionErrorCallback -> m SignalHandlerId Source #
Connect a signal handler for the error signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
websocketConnection #error callback
genClosure_WebsocketConnectionError :: MonadIO m => WebsocketConnectionErrorCallback -> m (GClosure C_WebsocketConnectionErrorCallback) Source #
Wrap the callback into a GClosure
.
mk_WebsocketConnectionErrorCallback :: C_WebsocketConnectionErrorCallback -> IO (FunPtr C_WebsocketConnectionErrorCallback) Source #
Generate a function pointer callable from C code, from a C_WebsocketConnectionErrorCallback
.
noWebsocketConnectionErrorCallback :: Maybe WebsocketConnectionErrorCallback Source #
A convenience synonym for
.Nothing
:: Maybe
WebsocketConnectionErrorCallback
onWebsocketConnectionError :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionErrorCallback -> m SignalHandlerId Source #
Connect a signal handler for the error signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
websocketConnection #error callback
wrap_WebsocketConnectionErrorCallback :: WebsocketConnectionErrorCallback -> C_WebsocketConnectionErrorCallback Source #
message
type C_WebsocketConnectionMessageCallback = Ptr () -> Int32 -> Ptr Bytes -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type WebsocketConnectionMessageCallback Source #
Emitted when we receive a message from the peer.
As a convenience, the message
data will always be
NUL-terminated, but the NUL byte will not be included in
the length count.
Since: 2.50
afterWebsocketConnectionMessage :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionMessageCallback -> m SignalHandlerId Source #
Connect a signal handler for the message signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
websocketConnection #message callback
genClosure_WebsocketConnectionMessage :: MonadIO m => WebsocketConnectionMessageCallback -> m (GClosure C_WebsocketConnectionMessageCallback) Source #
Wrap the callback into a GClosure
.
mk_WebsocketConnectionMessageCallback :: C_WebsocketConnectionMessageCallback -> IO (FunPtr C_WebsocketConnectionMessageCallback) Source #
Generate a function pointer callable from C code, from a C_WebsocketConnectionMessageCallback
.
noWebsocketConnectionMessageCallback :: Maybe WebsocketConnectionMessageCallback Source #
A convenience synonym for
.Nothing
:: Maybe
WebsocketConnectionMessageCallback
onWebsocketConnectionMessage :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionMessageCallback -> m SignalHandlerId Source #
Connect a signal handler for the message signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
websocketConnection #message callback
wrap_WebsocketConnectionMessageCallback :: WebsocketConnectionMessageCallback -> C_WebsocketConnectionMessageCallback Source #
pong
type C_WebsocketConnectionPongCallback = Ptr () -> Ptr Bytes -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type WebsocketConnectionPongCallback Source #
Emitted when we receive a Pong frame (solicited or unsolicited) from the peer.
As a convenience, the message
data will always be
NUL-terminated, but the NUL byte will not be included in
the length count.
Since: 2.60
afterWebsocketConnectionPong :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionPongCallback -> m SignalHandlerId Source #
Connect a signal handler for the pong signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
websocketConnection #pong callback
genClosure_WebsocketConnectionPong :: MonadIO m => WebsocketConnectionPongCallback -> m (GClosure C_WebsocketConnectionPongCallback) Source #
Wrap the callback into a GClosure
.
mk_WebsocketConnectionPongCallback :: C_WebsocketConnectionPongCallback -> IO (FunPtr C_WebsocketConnectionPongCallback) Source #
Generate a function pointer callable from C code, from a C_WebsocketConnectionPongCallback
.
noWebsocketConnectionPongCallback :: Maybe WebsocketConnectionPongCallback Source #
A convenience synonym for
.Nothing
:: Maybe
WebsocketConnectionPongCallback
onWebsocketConnectionPong :: (IsWebsocketConnection a, MonadIO m) => a -> WebsocketConnectionPongCallback -> m SignalHandlerId Source #
Connect a signal handler for the pong signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
websocketConnection #pong callback