org.eclipse.jetty.websocket
Class WebSocketConnectionD00

java.lang.Object
  extended by org.eclipse.jetty.io.AbstractConnection
      extended by org.eclipse.jetty.websocket.WebSocketConnectionD00
All Implemented Interfaces:
Connection, Idleable, WebSocket.Outbound, WebSocketConnection

public class WebSocketConnectionD00
extends AbstractConnection
implements WebSocketConnection, WebSocket.Outbound


Field Summary
 
Fields inherited from class org.eclipse.jetty.io.AbstractConnection
_endp
 
Constructor Summary
WebSocketConnectionD00(WebSocket websocket, EndPoint endpoint, int draft)
           
WebSocketConnectionD00(WebSocket websocket, EndPoint endpoint, WebSocketBuffers buffers, long timestamp, int maxIdleTime, int draft)
           
 
Method Summary
 void closed()
          Called when the connection is closed
 void disconnect()
           
 void disconnect(int code, String message)
           
static byte[] doTheHixieHixieShake(long key1, long key2, byte[] key3)
           
 void fillBuffersFrom(Buffer buffer)
           
 Connection handle()
          Handle the connection.
 void handshake(HttpServletRequest request, HttpServletResponse response, String origin, String subprotocol)
           
 boolean isIdle()
           
 boolean isOpen()
           
 boolean isSuspended()
           
 void sendFragment(boolean more, byte opcode, byte[] content, int offset, int length)
          
 void sendMessage(byte opcode, byte[] content, int offset, int length)
          
 void sendMessage(byte frame, String content)
          
 void sendMessage(String content)
          
 void setHixieKeys(String key1, String key2)
           
 
Methods inherited from class org.eclipse.jetty.io.AbstractConnection
getEndPoint, getTimeStamp, idleExpired, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.jetty.io.Connection
getTimeStamp
 

Constructor Detail

WebSocketConnectionD00

public WebSocketConnectionD00(WebSocket websocket,
                              EndPoint endpoint,
                              int draft)
                       throws IOException
Throws:
IOException

WebSocketConnectionD00

public WebSocketConnectionD00(WebSocket websocket,
                              EndPoint endpoint,
                              WebSocketBuffers buffers,
                              long timestamp,
                              int maxIdleTime,
                              int draft)
                       throws IOException
Throws:
IOException
Method Detail

setHixieKeys

public void setHixieKeys(String key1,
                         String key2)

handle

public Connection handle()
                  throws IOException
Description copied from interface: Connection
Handle the connection.

Specified by:
handle in interface Connection
Returns:
The Connection to use for the next handling of the connection. This allows protocol upgrades and support for CONNECT.
Throws:
IOException

isOpen

public boolean isOpen()
Specified by:
isOpen in interface WebSocket.Outbound

isIdle

public boolean isIdle()
Specified by:
isIdle in interface Connection

isSuspended

public boolean isSuspended()
Specified by:
isSuspended in interface Connection

closed

public void closed()
Description copied from interface: Connection
Called when the connection is closed

Specified by:
closed in interface Connection

sendMessage

public void sendMessage(String content)
                 throws IOException

Specified by:
sendMessage in interface WebSocket.Outbound
Throws:
IOException

sendMessage

public void sendMessage(byte frame,
                        String content)
                 throws IOException

Specified by:
sendMessage in interface WebSocket.Outbound
Throws:
IOException

sendMessage

public void sendMessage(byte opcode,
                        byte[] content,
                        int offset,
                        int length)
                 throws IOException

Specified by:
sendMessage in interface WebSocket.Outbound
Throws:
IOException

sendFragment

public void sendFragment(boolean more,
                         byte opcode,
                         byte[] content,
                         int offset,
                         int length)
                  throws IOException

Specified by:
sendFragment in interface WebSocket.Outbound
Throws:
IOException

disconnect

public void disconnect(int code,
                       String message)
Specified by:
disconnect in interface WebSocket.Outbound

disconnect

public void disconnect()
Specified by:
disconnect in interface WebSocket.Outbound

fillBuffersFrom

public void fillBuffersFrom(Buffer buffer)
Specified by:
fillBuffersFrom in interface WebSocketConnection

doTheHixieHixieShake

public static byte[] doTheHixieHixieShake(long key1,
                                          long key2,
                                          byte[] key3)

handshake

public void handshake(HttpServletRequest request,
                      HttpServletResponse response,
                      String origin,
                      String subprotocol)
               throws IOException
Specified by:
handshake in interface WebSocketConnection
Throws:
IOException


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