Class WebsocketExtension
- All Implemented Interfaces:
Proxy
- Direct Known Subclasses:
WebsocketExtension.WebsocketExtension$Impl, WebsocketExtensionDeflate
A WebSocket extension
WebsocketExtension is the base class for WebSocket extension objects.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInner class implementing a builder pattern to construct a GObject with properties.static classThe WebsocketExtension$Impl type represents a native instance of the abstract WebsocketExtension class.static classThe class structure for theWebsocketExtension.Nested classes/interfaces inherited from class GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new WebsocketExtension.WebsocketExtension(MemorySegment address) Create a WebsocketExtension instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected WebsocketExtensionasParent()Return this instance as if it were its parent type.booleanconfigure(WebsocketConnectionType connectionType, @Nullable HashTable<MemorySegment, MemorySegment> params) Configures this WebsocketExtension with the givenparams.static MemoryLayoutThe memory layout of the native struct.@Nullable StringGet the parameters strings to be included in the request header.@Nullable StringGet the parameters strings to be included in the response header.static @Nullable TypegetType()Get the GType of the WebsocketExtension class.byte[]processIncomingMessage(Out<Byte> header, byte[] payload) Process a message after it's received.byte[]processOutgoingMessage(Out<Byte> header, byte[] payload) Process a message before it's sent.Methods inherited from class GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, builder, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newv, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withPropertiesMethods inherited from class TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
WebsocketExtension
Create a WebsocketExtension instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
WebsocketExtension
public WebsocketExtension()Create a new WebsocketExtension.
-
-
Method Details
-
getType
Get the GType of the WebsocketExtension class.- Returns:
- the GType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Return this instance as if it were its parent type. Comparable to the Javasuperkeyword, but ensures the parent typeclass is also used in native code. -
configure
public boolean configure(WebsocketConnectionType connectionType, @Nullable HashTable<MemorySegment, MemorySegment> params) throws GErrorException Configures this WebsocketExtension with the givenparams.- Parameters:
connectionType- eitherWebsocketConnectionType.CLIENTorWebsocketConnectionType.SERVERparams- the parameters- Returns:
trueif extension could be configured with the given parameters, orfalseotherwise- Throws:
GErrorException- seeGError
-
getRequestParams
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
null.- Returns:
- a new allocated string with the parameters
-
getResponseParams
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
null.- Returns:
- a new allocated string with the parameters
-
processIncomingMessage
Process a message after it's received.
If the payload isn't changed the given
payloadis just returned, otherwiseorg.gnome.glib.Bytes.unrefis called on the givenpayloadand a newGLib.Bytesis returned with the new data.Extensions using reserved bits of the header will reset them in
header.- Parameters:
header- the message headerpayload- the payload data- Returns:
- the message payload data, or
nullin case of error - Throws:
GErrorException- seeGError
-
processOutgoingMessage
Process a message before it's sent.
If the payload isn't changed the given
payloadis just returned, otherwiseorg.gnome.glib.Bytes.unrefis called on the givenpayloadand a newGLib.Bytesis returned with the new data.Extensions using reserved bits of the header will change them in
header.- Parameters:
header- the message headerpayload- the payload data- Returns:
- the message payload data, or
nullin case of error - Throws:
GErrorException- seeGError
-