Struct xpcom::interfaces::nsIWebSocketListener [] [src]

#[repr(C)]
pub struct nsIWebSocketListener { /* fields omitted */ }

interface nsIWebSocketListener : nsISupports

/**
 * nsIWebSocketListener: passed to nsIWebSocketChannel::AsyncOpen. Receives
 * websocket traffic events as they arrive.
 */

Methods

impl nsIWebSocketListener
[src]

[src]

Cast this nsIWebSocketListener to one of its base interfaces.

impl nsIWebSocketListener
[src]

[src]

/**
     * Called to signify the establishment of the message stream.
     *
     * Unlike most other networking channels (which use nsIRequestObserver
     * instead of this class), we do not guarantee that OnStart is always
     * called: OnStop is called without calling this function if errors occur
     * during connection setup.  If the websocket connection is successful,
     * OnStart will be called before any other calls to this API.
     *
     * @param aContext user defined context
     */

[must_use] void onStart (in nsISupports aContext);

[src]

/**
     * Called to signify the completion of the message stream.
     * OnStop is the final notification the listener will receive and it
     * completes the WebSocket connection: after it returns the
     * nsIWebSocketChannel will release its reference to the listener.
     *
     * Note: this event can be received in error cases even if
     * nsIWebSocketChannel::Close() has not been called.
     *
     * @param aContext user defined context
     * @param aStatusCode reason for stopping (NS_OK if completed successfully)
     */

[must_use] void onStop (in nsISupports aContext, in nsresult aStatusCode);

[src]

/**
     * Called to deliver text message.
     *
     * @param aContext user defined context
     * @param aMsg the message data
     */

[must_use] void onMessageAvailable (in nsISupports aContext, in AUTF8String aMsg);

[src]

/**
     * Called to deliver binary message.
     *
     * @param aContext user defined context
     * @param aMsg the message data
     */

[must_use] void onBinaryMessageAvailable (in nsISupports aContext, in ACString aMsg);

[src]

/**
     * Called to acknowledge message sent via sendMsg() or sendBinaryMsg.
     *
     * @param aContext user defined context
     * @param aSize number of bytes placed in OS send buffer
     */

[must_use] void onAcknowledge (in nsISupports aContext, in uint32_t aSize);

[src]

/**
     * Called to inform receipt of WebSocket Close message from server.
     * In the case of errors onStop() can be called without ever
     * receiving server close.
     *
     * No additional messages through onMessageAvailable(),
     * onBinaryMessageAvailable() or onAcknowledge() will be delievered
     * to the listener after onServerClose(), though outgoing messages can still
     * be sent through the nsIWebSocketChannel connection.
     *
     * @param aContext user defined context
     * @param aCode the websocket closing handshake close code.
     * @param aReason the websocket closing handshake close reason
     */

[must_use] void onServerClose (in nsISupports aContext, in unsigned short aCode, in AUTF8String aReason);

Methods from Deref<Target = nsISupports>

[src]

Cast this nsISupports to one of its base interfaces.

[src]

void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);

[src]

[noscript,notxpcom] nsrefcnt AddRef ();

[src]

[noscript,notxpcom] nsrefcnt Release ();

Trait Implementations

impl XpCom for nsIWebSocketListener
[src]

IID: nsIID = nsID(3612120754, 26035, 20025, [158, 57, 197, 119, 222, 93, 122, 115])

[src]

Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more

impl RefCounted for nsIWebSocketListener
[src]

[src]

Increment the reference count.

[src]

Decrement the reference count, potentially freeing backing memory.

impl Deref for nsIWebSocketListener
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.