Class
SoupWebsocketConnection
since: 3.0
Description [src]
final class Soup.WebsocketConnection : GObject.Object
{
/* No available fields */
}
The WebSocket Protocol
Provides support for the WebSocket protocol.
To connect to a WebSocket server, create a SoupSession
and call
soup_session_websocket_connect_async()
. To accept WebSocket
connections, create a SoupServer
and add a handler to it with
soup_server_add_websocket_handler()
.
(Lower-level support is available via
soup_websocket_client_prepare_handshake()
and
soup_websocket_client_verify_handshake()
, for handling the client side of the
WebSocket handshake, and soup_websocket_server_process_handshake()
for
handling the server side.)
SoupWebsocketConnection
handles the details of WebSocket communication. You
can use soup_websocket_connection_send_text()
and
soup_websocket_connection_send_binary()
to send data, and the
SoupWebsocketConnection::message
signal to receive data.
(SoupWebsocketConnection
currently only supports asynchronous I/O.)
Available since: 3.0
Constructors
soup_websocket_connection_new
Creates a SoupWebsocketConnection
on stream
with the given active extensions
.
since: 3.0
Instance methods
soup_websocket_connection_get_close_code
Get the close code received from the WebSocket peer.
since: 3.0
soup_websocket_connection_get_close_data
Get the close data received from the WebSocket peer.
since: 3.0
soup_websocket_connection_get_connection_type
Get the connection type (client/server) of the connection.
since: 3.0
soup_websocket_connection_get_extensions
Get the extensions chosen via negotiation with the peer.
since: 3.0
soup_websocket_connection_get_io_stream
Get the I/O stream the WebSocket is communicating over.
since: 3.0
soup_websocket_connection_get_keepalive_interval
Gets the keepalive interval in seconds or 0 if disabled.
since: 3.0
soup_websocket_connection_get_max_incoming_payload_size
Gets the maximum payload size allowed for incoming packets.
since: 3.0
soup_websocket_connection_get_protocol
Get the protocol chosen via negotiation with the peer.
since: 3.0
soup_websocket_connection_send_message
Send a message of the given type
to the peer. Note that this method,
allows to send text messages containing NULL
characters.
since: 3.0
soup_websocket_connection_send_text
Send a NULL
-terminated text (UTF-8) message to the peer.
since: 3.0
soup_websocket_connection_set_keepalive_interval
Sets the interval in seconds on when to send a ping message which will serve as a keepalive message.
since: 3.0
soup_websocket_connection_set_max_incoming_payload_size
Sets the maximum payload size allowed for incoming packets.
since: 3.0
Properties
Soup.WebsocketConnection:extensions
List of SoupWebsocketExtension
objects that are active in the connection.
since: 3.0
Soup.WebsocketConnection:io-stream
The underlying IO stream the WebSocket is communicating over.
since: 3.0
Soup.WebsocketConnection:keepalive-interval
Interval in seconds on when to send a ping message which will serve as a keepalive message.
since: 3.0
Soup.WebsocketConnection:max-incoming-payload-size
The maximum payload size for incoming packets.
since: 3.0
Soup.WebsocketConnection:protocol
The chosen protocol, or NULL
if a protocol was not agreed upon.
since: 3.0
Signals
Soup.WebsocketConnection::pong
Emitted when we receive a Pong frame (solicited or unsolicited) from the peer.
since: 3.0
Signals inherited from GObject (1)
GObject::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.
since: 2.0
Class structure
struct SoupWebsocketConnectionClass {
GObjectClass parent_class;
}
The abstract base class for SoupWebsocketConnection
.
Class members
parent_class: GObjectClass
- No description available.