org.eclipse.jetty.websocket
Interface WebSocket.Connection

All Known Subinterfaces:
WebSocket.FrameConnection
All Known Implementing Classes:
WebSocketConnectionD00
Enclosing interface:
WebSocket

public static interface WebSocket.Connection

A Connection interface is passed to a WebSocket instance via the WebSocket.onOpen(Connection) to give the application access to the specifics of the current connection. This includes methods for sending frames and messages as well as methods for interpreting the flags and opcodes of the connection.


Method Summary
 void disconnect()
           
 int getMaxBinaryMessageSize()
          Size in bytes of the maximum binary message to be received
 int getMaxTextMessageSize()
          Size in characters of the maximum text message to be received
 String getProtocol()
           
 boolean isOpen()
           
 void sendMessage(byte[] data, int offset, int length)
           
 void sendMessage(String data)
           
 void setMaxBinaryMessageSize(int size)
           
 void setMaxTextMessageSize(int size)
           
 

Method Detail

getProtocol

String getProtocol()

sendMessage

void sendMessage(String data)
                 throws IOException
Throws:
IOException

sendMessage

void sendMessage(byte[] data,
                 int offset,
                 int length)
                 throws IOException
Throws:
IOException

disconnect

void disconnect()

isOpen

boolean isOpen()

setMaxTextMessageSize

void setMaxTextMessageSize(int size)
Parameters:
size - size<0 No aggregation of frames to messages, >=0 max size of text frame aggregation buffer in characters

setMaxBinaryMessageSize

void setMaxBinaryMessageSize(int size)
Parameters:
size - size<0 no aggregation of binary frames, >=0 size of binary frame aggregation buffer

getMaxTextMessageSize

int getMaxTextMessageSize()
Size in characters of the maximum text message to be received

Returns:
size <0 No aggregation of frames to messages, >=0 max size of text frame aggregation buffer in characters

getMaxBinaryMessageSize

int getMaxBinaryMessageSize()
Size in bytes of the maximum binary message to be received

Returns:
size <0 no aggregation of binary frames, >=0 size of binary frame aggregation buffer


Copyright © 1995-2011 Mort Bay Consulting. All Rights Reserved.