WebsocketConnection
Object Hierarchy:
Soup.WebsocketConnection
Soup.WebsocketConnection
Soup.WebsocketConnection
GLib.Object
GLib.Object
GLib.Object->Soup.WebsocketConnection
Description:
[ CCode ( type_id = "soup_websocket_connection_get_type ()" ) ] [ Version ( since = "2.50" ) ]public class WebsocketConnection : Object
A class representing a WebSocket connection.
Content:
Properties:
public WebsocketConnectionType connection_type { get ; construct ; }
The type of connection (client/server).
public void * extensions { get ; construct ; }
public IOStream io_stream { get ; construct ; }
The underlying IO stream the WebSocket is communicating over.
public uint keepalive_interval { get ; set construct ; }
Interval in seconds on when to send a ping message which will serve as
a keepalive message.
public uint64 max_incoming_payload_size { get ; set construct ; }
The maximum payload size for incoming packets the protocol expects or
0 to not limit it.
public string origin { get ; construct ; }
The client's Origin.
public string protocol { get ; construct ; }
The chosen protocol, or null
if a protocol was not agreed
upon.
public WebsocketState state { get ; }
The current state of the WebSocket.
public URI uri { get ; construct ; }
The URI of the WebSocket.
Creation methods:
Methods:
public void close (ushort code, string ? data)
Close the connection in an orderly fashion.
public ushort get_close_code ()
Get the close code received from the WebSocket peer.
public unowned string get_close_data ()
Get the close data received from the WebSocket peer.
public WebsocketConnectionType get_connection_type ()
Get the connection type (client/server) of the connection.
public unowned List <WebsocketExtension > get_extensions ()
Get the extensions chosen via negotiation with the peer.
public unowned IOStream get_io_stream ()
Get the I/O stream the WebSocket is communicating over.
public uint get_keepalive_interval ()
Gets the keepalive interval in seconds or 0 if disabled.
public uint64 get_max_incoming_payload_size ()
Gets the maximum payload size allowed for incoming packets.
public unowned string ? get_origin ()
Get the origin of the WebSocket.
public unowned string ? get_protocol ()
Get the protocol chosen via negotiation with the peer.
public WebsocketState get_state ()
Get the current state of the WebSocket.
public unowned URI get_uri ()
Get the URI of the WebSocket.
public void send_binary (uint8 []? data)
Send a binary message to the peer.
public void send_message (WebsocketDataType type, Bytes message)
Send a message of the given type
to the peer.
public void send_text (string text)
Send a null
-terminated text (UTF-8) message to the peer.
public void set_keepalive_interval (uint interval)
Sets the interval in seconds on when to send a ping message which will
serve as a keepalive message.
public void set_max_incoming_payload_size (uint64 max_incoming_payload_size)
Sets the maximum payload size allowed for incoming packets.
Signals:
public virtual signal void closed ()
Emitted when the connection has completely closed, either due to an
orderly close from the peer, one initiated via close or a fatal error
condition that caused a close.
public virtual signal void closing ()
This signal will be emitted during an orderly close.
public virtual signal void error (Error error)
Emitted when an error occurred on the WebSocket.
public virtual signal void message (int type, Bytes message)
Emitted when we receive a message from the peer.
public virtual signal void pong (Bytes message)
Emitted when we receive a Pong frame (solicited or unsolicited) from
the peer.
Inherited Members:
All known members inherited from class GLib.Object
@get
@new
@ref
@set
add_toggle_ref
add_weak_pointer
bind_property
connect
constructed
disconnect
dispose
dup_data
dup_qdata
force_floating
freeze_notify
get_class
get_data
get_property
get_qdata
get_type
getv
interface_find_property
interface_install_property
interface_list_properties
is_floating
new_valist
new_with_properties
newv
notify
notify_property
ref_count
ref_sink
remove_toggle_ref
remove_weak_pointer
replace_data
replace_qdata
set_data
set_data_full
set_property
set_qdata
set_qdata_full
set_valist
setv
steal_data
steal_qdata
thaw_notify
unref
watch_closure
weak_ref
weak_unref