org.eclipse.jetty.websocket
Interface WebSocket

All Known Subinterfaces:
WebSocket.OnBinaryMessage, WebSocket.OnControl, WebSocket.OnFrame, WebSocket.OnTextMessage

public interface WebSocket

Fake class for portability across servers.


Nested Class Summary
static interface WebSocket.Connection
          A Connection interface is passed to a WebSocket instance via the onOpen(Connection) to give the application access to the specifics of the current connection.
static interface WebSocket.FrameConnection
          Frame Level Connection
static interface WebSocket.OnBinaryMessage
          A nested WebSocket interface for receiving binary messages
static interface WebSocket.OnControl
          A nested WebSocket interface for receiving control messages
static interface WebSocket.OnFrame
          A nested WebSocket interface for receiving any websocket frame
static interface WebSocket.OnTextMessage
           
static interface WebSocket.Outbound
           
 
Field Summary
static byte LENGTH_FRAME
           
static byte SENTINEL_FRAME
           
 
Method Summary
 void onClose(int closeCode, String message)
          Called when an established websocket connection closes
 void onConnect(WebSocket.Outbound outbound)
           
 void onDisconnect()
           
 void onFragment(boolean more, byte opcode, byte[] data, int offset, int length)
           
 void onMessage(byte frame, byte[] data, int offset, int length)
           
 void onMessage(byte frame, String data)
           
 void onOpen(WebSocket.Connection connection)
          Called when a new websocket connection is accepted.
 

Field Detail

LENGTH_FRAME

static final byte LENGTH_FRAME
See Also:
Constant Field Values

SENTINEL_FRAME

static final byte SENTINEL_FRAME
See Also:
Constant Field Values
Method Detail

onConnect

void onConnect(WebSocket.Outbound outbound)

onMessage

void onMessage(byte frame,
               String data)

onMessage

void onMessage(byte frame,
               byte[] data,
               int offset,
               int length)

onFragment

void onFragment(boolean more,
                byte opcode,
                byte[] data,
                int offset,
                int length)

onDisconnect

void onDisconnect()

onOpen

void onOpen(WebSocket.Connection connection)
Called when a new websocket connection is accepted.

Parameters:
connection - The Connection object to use to send messages.

onClose

void onClose(int closeCode,
             String message)
Called when an established websocket connection closes

Parameters:
closeCode -
message -


Copyright © 2012. All Rights Reserved.