nsIWebSocketChannel.asyncOpen()
.
nsISupports
Last changed in Gecko 8.0 (Firefox 8.0 / Thunderbird 8.0 / SeaMonkey 2.5)void onAcknowledge(in nsISupports aContext, in PRUint32 aSize); |
void onBinaryMessageAvailable(in nsISupports aContext, in ACString aMsg); |
void onMessageAvailable(in nsISupports aContext, in AUTF8String aMsg); |
void onServerClose(in nsISupports aContext, in unsigned short aCode, in AUTF8String aReason); |
void onStart(in nsISupports aContext); |
void onStop(in nsISupports aContext, in nsresult aStatusCode); |
Called to acknowledge a message sent via nsIWebSocketChannel.sendMsg()
or nsIWebSocketChannel.sendBinaryMsg()
.
void onAcknowledge( in nsISupports aContext, in PRUint32 aSize );
aContext
aSize
Called when a binary message has been received.
void onBinaryMessageAvailable( in nsISupports aContext, in ACString aMsg );
aContext
aMsg
Called when a text message has been received.
void onMessageAvailable( in nsISupports aContext, in AUTF8String aMsg );
aContext
aMsg
Called when the server sends a close message. In the case of errors, onStop()
may be called without this method ever getting called.
No additional messages through onMessageAvailable()
, onBinaryMessageAvailable()
() or onAcknowledge()
() will be delievered to the listener after onServerClose()
is called, but outgoing messages can still be sent through the nsIWebSocketChannel
connection.
void onServerClose( in nsISupports aContext, in unsigned short aCode, in AUTF8String aReason );
aContext
aCode
aReason
Called to signify the establishment of the message stream. Any listener that receives onStart()
will also receive OnStop()
.
void onStart( in nsISupports aContext );
aContext
Called to signify the completion of the message stream. This is the final notification the listener will receive; once it's been received, the WebSocket connection is complete. This event can be received in error cases even if nsIWebSocketChannel.close()
has not been called.
void onStop( in nsISupports aContext, in nsresult aStatusCode );
aContext
aStatusCode
NS_OK
if completed successfully).