Struct xpcom::interfaces::nsIWebSocketChannel [] [src]

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

interface nsIWebSocketChannel : nsISupports

/**
 * Low-level websocket API: handles network protocol.
 *
 * This is primarly intended for use by the higher-level nsIWebSocket.idl.
 * We are also making it scriptable for now, but this may change once we have
 * WebSockets for Workers.
 */

Methods

impl nsIWebSocketChannel
[src]

[src]

Cast this nsIWebSocketChannel to one of its base interfaces.

impl nsIWebSocketChannel
[src]

CLOSE_NORMAL: i64 = 1000

CLOSE_GOING_AWAY: i64 = 1001

CLOSE_PROTOCOL_ERROR: i64 = 1002

CLOSE_UNSUPPORTED_DATATYPE: i64 = 1003

CLOSE_NO_STATUS: i64 = 1005

CLOSE_ABNORMAL: i64 = 1006

CLOSE_INVALID_PAYLOAD: i64 = 1007

CLOSE_POLICY_VIOLATION: i64 = 1008

CLOSE_TOO_LARGE: i64 = 1009

CLOSE_EXTENSION_MISSING: i64 = 1010

CLOSE_INTERNAL_ERROR: i64 = 1011

CLOSE_TLS_FAILED: i64 = 1015

[src]

/**
     * The original URI used to construct the protocol connection. This is used
     * in the case of a redirect or URI "resolution" (e.g. resolving a
     * resource: URI to a file: URI) so that the original pre-redirect
     * URI can still be obtained.  This is never null.
     */

[must_use] readonly attribute nsIURI originalURI;

[src]

/**
     * The readonly URI corresponding to the protocol connection after any
     * redirections are completed.
     */

[must_use] readonly attribute nsIURI URI;

[src]

/**
     * The notification callbacks for authorization, etc..
     */

[must_use] attribute nsIInterfaceRequestor notificationCallbacks;

[src]

/**
     * The notification callbacks for authorization, etc..
     */

[must_use] attribute nsIInterfaceRequestor notificationCallbacks;

[src]

/**
     * Transport-level security information (if any)
     */

[must_use] readonly attribute nsISupports securityInfo;

[src]

/**
     * The load group of of the websocket
     */

[must_use] attribute nsILoadGroup loadGroup;

[src]

/**
     * The load group of of the websocket
     */

[must_use] attribute nsILoadGroup loadGroup;

[src]

/**
     * The load info of the websocket
     */

[must_use] attribute nsILoadInfo loadInfo;

[src]

/**
     * The load info of the websocket
     */

[must_use] attribute nsILoadInfo loadInfo;

[src]

/**
     * Sec-Websocket-Protocol value
     */

[must_use] attribute ACString protocol;

[src]

/**
     * Sec-Websocket-Protocol value
     */

[must_use] attribute ACString protocol;

[src]

/**
     * Sec-Websocket-Extensions response header value
     */

[must_use] readonly attribute ACString extensions;

[src]

/**
     * Init the WebSocketChannel with LoadInfo arguments.
     * @param aLoadingNode
     * @param aLoadingPrincipal
     * @param aTriggeringPrincipal
     * @param aSecurityFlags
     * @param aContentPolicyType
     *        These will be used as values for the nsILoadInfo object on the
     *        created channel. For details, see nsILoadInfo in nsILoadInfo.idl
     * @return reference to the new nsIChannel object
     *
     * Keep in mind that URIs coming from a webpage should *never* use the
     * systemPrincipal as the loadingPrincipal.
     *
     * Please note, if you provide both a loadingNode and a loadingPrincipal,
     * then loadingPrincipal must be equal to loadingNode->NodePrincipal().
     * But less error prone is to just supply a loadingNode.
     */

[must_use] void initLoadInfo (in nsIDOMNode aLoadingNode, in nsIPrincipal aLoadingPrincipal, in nsIPrincipal aTriggeringPrincipal, in unsigned long aSecurityFlags, in unsigned long aContentPolicyType);

[src]

/**
     * Asynchronously open the websocket connection.  Received messages are fed
     * to the socket listener as they arrive.  The socket listener's methods
     * are called on the thread that calls asyncOpen and are not called until
     * after asyncOpen returns.  If asyncOpen returns successfully, the
     * protocol implementation promises to call at least onStop on the listener.
     *
     * NOTE: Implementations should throw NS_ERROR_ALREADY_OPENED if the
     * websocket connection is reopened.
     *
     * @param aURI the uri of the websocket protocol - may be redirected
     * @param aOrigin the uri of the originating resource
     * @param aInnerWindowID the inner window ID
     * @param aListener the nsIWebSocketListener implementation
     * @param aContext an opaque parameter forwarded to aListener's methods
     */

[must_use] void asyncOpen (in nsIURI aURI, in ACString aOrigin, in unsigned long long aInnerWindowID, in nsIWebSocketListener aListener, in nsISupports aContext);

[src]

[must_use] void close (in unsigned short aCode, in AUTF8String aReason);

[src]

/**
     * Use to send text message down the connection to WebSocket peer.
     *
     * @param aMsg the utf8 string to send
     */

[must_use] void sendMsg (in AUTF8String aMsg);

[src]

/**
     * Use to send binary message down the connection to WebSocket peer.
     *
     * @param aMsg the data to send
     */

[must_use] void sendBinaryMsg (in ACString aMsg);

[src]

/**
     * Use to send a binary stream (Blob) to Websocket peer.
     *
     * @param aStream The input stream to be sent.
     */

[must_use] void sendBinaryStream (in nsIInputStream aStream, in unsigned long length);

[src]

/**
     * This value determines how often (in seconds) websocket keepalive
     * pings are sent.  If set to 0 (the default), no pings are ever sent.
     *
     * This value can currently only be set before asyncOpen is called, else
     * NS_ERROR_IN_PROGRESS is thrown.
     *
     * Be careful using this setting: ping traffic can consume lots of power and
     * bandwidth over time.
     */

[must_use] attribute unsigned long pingInterval;

[src]

/**
     * This value determines how often (in seconds) websocket keepalive
     * pings are sent.  If set to 0 (the default), no pings are ever sent.
     *
     * This value can currently only be set before asyncOpen is called, else
     * NS_ERROR_IN_PROGRESS is thrown.
     *
     * Be careful using this setting: ping traffic can consume lots of power and
     * bandwidth over time.
     */

[must_use] attribute unsigned long pingInterval;

[src]

/**
     * This value determines how long (in seconds) the websocket waits for
     * the server to reply to a ping that has been sent before considering the
     * connection broken.
     *
     * This value can currently only be set before asyncOpen is called, else
     * NS_ERROR_IN_PROGRESS is thrown.
     */

[must_use] attribute unsigned long pingTimeout;

[src]

/**
     * This value determines how long (in seconds) the websocket waits for
     * the server to reply to a ping that has been sent before considering the
     * connection broken.
     *
     * This value can currently only be set before asyncOpen is called, else
     * NS_ERROR_IN_PROGRESS is thrown.
     */

[must_use] attribute unsigned long pingTimeout;

[src]

/**
     * Unique ID for this channel. It's not readonly because when the channel is
     * created via IPC, the serial number is received from the child process.
     */

[must_use] attribute unsigned long serial;

[src]

/**
     * Unique ID for this channel. It's not readonly because when the channel is
     * created via IPC, the serial number is received from the child process.
     */

[must_use] attribute unsigned long serial;

[src]

/**
     * Set a nsITransportProvider and negotated extensions to be used by this
     * channel. Calling this function also means that this channel will
     * implement the server-side part of a websocket connection rather than the
     * client-side part.
     */

[must_use] void setServerParameters (in nsITransportProvider aProvider, in ACString aNegotiatedExtensions);

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 nsIWebSocketChannel
[src]

IID: nsIID = nsID(3463565352, 12842, 16645, [169, 71, 168, 148, 104, 155, 82, 191])

[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 nsIWebSocketChannel
[src]

[src]

Increment the reference count.

[src]

Decrement the reference count, potentially freeing backing memory.

impl Deref for nsIWebSocketChannel
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.