Soup.WebsocketExtension

g GObject.Object GObject.Object Soup.WebsocketExtension Soup.WebsocketExtension GObject.Object->Soup.WebsocketExtension

Subclasses:

Soup.WebsocketExtensionDeflate

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

configure (connection_type, params)

get_request_params ()

get_response_params ()

process_incoming_message (header, payload)

process_outgoing_message (header, payload)

Virtual Methods

Inherited:

GObject.Object (7)

do_configure (connection_type, params)

do_get_request_params ()

do_get_response_params ()

do_process_incoming_message (header, payload)

do_process_outgoing_message (header, payload)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Soup.WebsocketExtension(**kwargs)
Bases:

GObject.Object

Abstract:

Yes

Structure:

Soup.WebsocketExtensionClass

A WebSocket extension

Soup.WebsocketExtension is the base class for WebSocket extension objects.

configure(connection_type, params)
Parameters:
Raises:

GLib.Error

Returns:

True if extension could be configured with the given parameters, or False otherwise

Return type:

bool

Configures self with the given params.

get_request_params()
Returns:

a new allocated string with the parameters

Return type:

str or None

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

get_response_params()
Returns:

a new allocated string with the parameters

Return type:

str or None

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

process_incoming_message(header, payload)
Parameters:
  • header (int) – the message header

  • payload (GLib.Bytes) – the payload data

Raises:

GLib.Error

Returns:

the message payload data, or None in case of error

header:

the message header

Return type:

(GLib.Bytes, header: int)

Process a message after it’s received.

If the payload isn’t changed the given payload is just returned, otherwise [method`GLib`.Bytes.unref] is called on the given payload and a new [struct`GLib`.Bytes] is returned with the new data.

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

process_outgoing_message(header, payload)
Parameters:
  • header (int) – the message header

  • payload (GLib.Bytes) – the payload data

Raises:

GLib.Error

Returns:

the message payload data, or None in case of error

header:

the message header

Return type:

(GLib.Bytes, header: int)

Process a message before it’s sent.

If the payload isn’t changed the given payload is just returned, otherwise [method`Glib`.Bytes.unref] is called on the given payload and a new [struct`GLib`.Bytes] is returned with the new data.

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

do_configure(connection_type, params) virtual
Parameters:
Returns:

True if extension could be configured with the given parameters, or False otherwise

Return type:

bool

Configures extension with the given params.

do_get_request_params() virtual
Returns:

a new allocated string with the parameters

Return type:

str or None

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

do_get_response_params() virtual
Returns:

a new allocated string with the parameters

Return type:

str or None

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

do_process_incoming_message(header, payload) virtual
Parameters:
  • header (int) – the message header

  • payload (GLib.Bytes) – the payload data

Returns:

the message payload data, or None in case of error

header:

the message header

Return type:

(GLib.Bytes, header: int)

Process a message after it’s received.

If the payload isn’t changed the given payload is just returned, otherwise [method`GLib`.Bytes.unref] is called on the given payload and a new [struct`GLib`.Bytes] is returned with the new data.

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

do_process_outgoing_message(header, payload) virtual
Parameters:
  • header (int) – the message header

  • payload (GLib.Bytes) – the payload data

Returns:

the message payload data, or None in case of error

header:

the message header

Return type:

(GLib.Bytes, header: int)

Process a message before it’s sent.

If the payload isn’t changed the given payload is just returned, otherwise [method`Glib`.Bytes.unref] is called on the given payload and a new [struct`GLib`.Bytes] is returned with the new data.

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