org.eclipse.jetty.websocket
类 WebSocketConnectionD00

java.lang.Object
  继承者 org.eclipse.jetty.io.AbstractConnection
      继承者 org.eclipse.jetty.websocket.WebSocketConnectionD00
所有已实现的接口:
Connection, AsyncConnection, WebSocket.Connection, WebSocket.FrameConnection, WebSocketConnection
直接已知子类:
WebSocketServletConnectionD00

public class WebSocketConnectionD00
extends AbstractConnection
implements WebSocketConnection, WebSocket.FrameConnection


字段摘要
static byte LENGTH_FRAME
           
static byte SENTINEL_FRAME
           
 
从类 org.eclipse.jetty.io.AbstractConnection 继承的字段
_endp
 
构造方法摘要
WebSocketConnectionD00(WebSocket websocket, EndPoint endpoint, WebSocketBuffers buffers, long timestamp, int maxIdleTime, String protocol)
           
 
方法摘要
 byte binaryOpcode()
           
 void close()
          Close the connection with normal close code.
 void close(int code, String message)
          Close the connection with specific closeCode and message.
 byte continuationOpcode()
           
 void disconnect()
           
static byte[] doTheHixieHixieShake(long key1, long key2, byte[] key3)
           
 void fillBuffersFrom(Buffer buffer)
           
 byte finMask()
           
 WebSocket.Connection getConnection()
           
 List<Extension> getExtensions()
           
 int getMaxBinaryMessageSize()
          Size in bytes of the maximum binary message to be received
 int getMaxIdleTime()
           
 int getMaxTextMessageSize()
          Size in characters of the maximum text message to be received
 String getProtocol()
           
 Connection handle()
          Handle the connection.
 boolean isAllowFrameFragmentation()
           
 boolean isBinary(byte opcode)
           
 boolean isClose(byte opcode)
           
 boolean isContinuation(byte opcode)
           
 boolean isControl(byte opcode)
           
 boolean isIdle()
           
 boolean isMessageComplete(byte flags)
           
 boolean isMore(byte flags)
           
 boolean isOpen()
           
 boolean isPing(byte opcode)
           
 boolean isPong(byte opcode)
           
 boolean isSuspended()
          The semantic of this method is to return true to indicate interest in further reads, or false otherwise, but it is misnamed and should be really called isReadInterested().
 boolean isText(byte opcode)
           
 void onClose()
          Called after the connection is closed
protected  void onFrameHandshake()
           
 void onInputShutdown()
           
protected  void onWebsocketOpen()
           
 void sendControl(byte code, byte[] content, int offset, int length)
          Send a control frame
 void sendFrame(byte flags, byte opcode, byte[] content, int offset, int length)
          Send an arbitrary frame
 void sendMessage(byte[] data, int offset, int length)
           
 void sendMessage(String content)
           
 void setAllowFrameFragmentation(boolean allowFragmentation)
          Set if frames larger than the frame buffer are handled with local fragmentations
 void setHixieKeys(String key1, String key2)
           
 void setMaxBinaryMessageSize(int size)
           
 void setMaxIdleTime(int ms)
           
 void setMaxTextMessageSize(int size)
           
 void shutdown()
           
 byte textOpcode()
           
 
从类 org.eclipse.jetty.io.AbstractConnection 继承的方法
getEndPoint, getTimeStamp, onIdleExpired, toString
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
从接口 org.eclipse.jetty.io.Connection 继承的方法
getTimeStamp, onIdleExpired
 

字段详细信息

LENGTH_FRAME

public static final byte LENGTH_FRAME
另请参见:
常量字段值

SENTINEL_FRAME

public static final byte SENTINEL_FRAME
另请参见:
常量字段值
构造方法详细信息

WebSocketConnectionD00

public WebSocketConnectionD00(WebSocket websocket,
                              EndPoint endpoint,
                              WebSocketBuffers buffers,
                              long timestamp,
                              int maxIdleTime,
                              String protocol)
                       throws IOException
抛出:
IOException
方法详细信息

getConnection

public WebSocket.Connection getConnection()
指定者:
接口 WebSocketConnection 中的 getConnection

setHixieKeys

public void setHixieKeys(String key1,
                         String key2)

handle

public Connection handle()
                  throws IOException
从接口 Connection 复制的描述
Handle the connection.

指定者:
接口 Connection 中的 handle
返回:
The Connection to use for the next handling of the connection. This allows protocol upgrades and support for CONNECT.
抛出:
IOException - if the handling of I/O operations fail

onInputShutdown

public void onInputShutdown()
                     throws IOException
指定者:
接口 AsyncConnection 中的 onInputShutdown
抛出:
IOException

isOpen

public boolean isOpen()
指定者:
接口 WebSocket.Connection 中的 isOpen

isIdle

public boolean isIdle()
指定者:
接口 Connection 中的 isIdle
返回:
whether this connection is idle, that is not parsing and not generating
另请参见:
Connection.onIdleExpired(long)

isSuspended

public boolean isSuspended()
从接口 Connection 复制的描述

The semantic of this method is to return true to indicate interest in further reads, or false otherwise, but it is misnamed and should be really called isReadInterested().

指定者:
接口 Connection 中的 isSuspended
返回:
true to indicate interest in further reads, false otherwise

onClose

public void onClose()
从接口 Connection 复制的描述
Called after the connection is closed

指定者:
接口 Connection 中的 onClose

sendMessage

public void sendMessage(String content)
                 throws IOException
指定者:
接口 WebSocket.Connection 中的 sendMessage
抛出:
IOException

sendMessage

public void sendMessage(byte[] data,
                        int offset,
                        int length)
                 throws IOException
指定者:
接口 WebSocket.Connection 中的 sendMessage
抛出:
IOException

isMore

public boolean isMore(byte flags)

sendControl

public void sendControl(byte code,
                        byte[] content,
                        int offset,
                        int length)
                 throws IOException
Send a control frame

指定者:
接口 WebSocket.FrameConnection 中的 sendControl
抛出:
IOException

sendFrame

public void sendFrame(byte flags,
                      byte opcode,
                      byte[] content,
                      int offset,
                      int length)
               throws IOException
从接口 WebSocket.FrameConnection 复制的描述
Send an arbitrary frame

指定者:
接口 WebSocket.FrameConnection 中的 sendFrame
抛出:
IOException

close

public void close(int code,
                  String message)
从接口 WebSocket.Connection 复制的描述
Close the connection with specific closeCode and message.

指定者:
接口 WebSocket.Connection 中的 close
参数:
code - The close code to send, or -1 for no close code
message - The message to send or null for no message

disconnect

public void disconnect()
指定者:
接口 WebSocket.Connection 中的 disconnect

close

public void close()
从接口 WebSocket.Connection 复制的描述
Close the connection with normal close code.

指定者:
接口 WebSocket.Connection 中的 close

shutdown

public void shutdown()
指定者:
接口 WebSocketConnection 中的 shutdown

fillBuffersFrom

public void fillBuffersFrom(Buffer buffer)
指定者:
接口 WebSocketConnection 中的 fillBuffersFrom

doTheHixieHixieShake

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

setMaxTextMessageSize

public void setMaxTextMessageSize(int size)
指定者:
接口 WebSocket.Connection 中的 setMaxTextMessageSize
参数:
size - size<0 No aggregation of frames to messages, >=0 max size of text frame aggregation buffer in characters

setMaxIdleTime

public void setMaxIdleTime(int ms)
指定者:
接口 WebSocket.Connection 中的 setMaxIdleTime
参数:
ms - The time in ms that the connection can be idle before closing

setMaxBinaryMessageSize

public void setMaxBinaryMessageSize(int size)
指定者:
接口 WebSocket.Connection 中的 setMaxBinaryMessageSize
参数:
size - size<0 no aggregation of binary frames, >=0 size of binary frame aggregation buffer

getMaxTextMessageSize

public int getMaxTextMessageSize()
从接口 WebSocket.Connection 复制的描述
Size in characters of the maximum text message to be received

指定者:
接口 WebSocket.Connection 中的 getMaxTextMessageSize
返回:
size <0 No aggregation of frames to messages, >=0 max size of text frame aggregation buffer in characters

getMaxIdleTime

public int getMaxIdleTime()
指定者:
接口 WebSocket.Connection 中的 getMaxIdleTime
返回:
The time in ms that the connection can be idle before closing

getMaxBinaryMessageSize

public int getMaxBinaryMessageSize()
从接口 WebSocket.Connection 复制的描述
Size in bytes of the maximum binary message to be received

指定者:
接口 WebSocket.Connection 中的 getMaxBinaryMessageSize
返回:
size <0 no aggregation of binary frames, >=0 size of binary frame aggregation buffer

getProtocol

public String getProtocol()
指定者:
接口 WebSocket.Connection 中的 getProtocol

onFrameHandshake

protected void onFrameHandshake()

onWebsocketOpen

protected void onWebsocketOpen()

isMessageComplete

public boolean isMessageComplete(byte flags)
指定者:
接口 WebSocket.FrameConnection 中的 isMessageComplete
参数:
flags - The flags bytes of a frame
返回:
True of the flags indicate a final frame.

binaryOpcode

public byte binaryOpcode()
指定者:
接口 WebSocket.FrameConnection 中的 binaryOpcode
返回:
The opcode of a binary message

textOpcode

public byte textOpcode()
指定者:
接口 WebSocket.FrameConnection 中的 textOpcode
返回:
The opcode of a text message

isControl

public boolean isControl(byte opcode)
指定者:
接口 WebSocket.FrameConnection 中的 isControl
返回:
True if the opcode is for a control frame

isText

public boolean isText(byte opcode)
指定者:
接口 WebSocket.FrameConnection 中的 isText
返回:
True if the opcode is for a text frame

isBinary

public boolean isBinary(byte opcode)
指定者:
接口 WebSocket.FrameConnection 中的 isBinary
返回:
True if the opcode is for a binary frame

isContinuation

public boolean isContinuation(byte opcode)
指定者:
接口 WebSocket.FrameConnection 中的 isContinuation
返回:
True if the opcode is for a continuation frame

isClose

public boolean isClose(byte opcode)
指定者:
接口 WebSocket.FrameConnection 中的 isClose
返回:
True if the opcode is a close control

isPing

public boolean isPing(byte opcode)
指定者:
接口 WebSocket.FrameConnection 中的 isPing
返回:
True if the opcode is a ping control

isPong

public boolean isPong(byte opcode)
指定者:
接口 WebSocket.FrameConnection 中的 isPong
返回:
True if the opcode is a pong control

getExtensions

public List<Extension> getExtensions()
指定者:
接口 WebSocketConnection 中的 getExtensions

continuationOpcode

public byte continuationOpcode()
指定者:
接口 WebSocket.FrameConnection 中的 continuationOpcode
返回:
The opcode of a continuation frame

finMask

public byte finMask()
指定者:
接口 WebSocket.FrameConnection 中的 finMask
返回:
Mask for the FIN bit.

setAllowFrameFragmentation

public void setAllowFrameFragmentation(boolean allowFragmentation)
从接口 WebSocket.FrameConnection 复制的描述
Set if frames larger than the frame buffer are handled with local fragmentations

指定者:
接口 WebSocket.FrameConnection 中的 setAllowFrameFragmentation

isAllowFrameFragmentation

public boolean isAllowFrameFragmentation()
指定者:
接口 WebSocket.FrameConnection 中的 isAllowFrameFragmentation
返回:
True if frames larger than the frame buffer are fragmented.


Copyright © 2013. All Rights Reserved.