public abstract class WebSocketClientHandshaker
extends java.lang.Object
限定符和类型 | 字段和说明 |
---|---|
protected java.util.Map<java.lang.String,java.lang.String> |
customHeaders |
限定符 | 构造器和说明 |
---|---|
protected |
WebSocketClientHandshaker(java.net.URI webSocketUrl,
WebSocketVersion version,
java.lang.String subprotocol,
java.util.Map<java.lang.String,java.lang.String> customHeaders)
Base constructor with default values
|
protected |
WebSocketClientHandshaker(java.net.URI webSocketUrl,
WebSocketVersion version,
java.lang.String subprotocol,
java.util.Map<java.lang.String,java.lang.String> customHeaders,
long maxFramePayloadLength)
Base constructor
|
限定符和类型 | 方法和说明 |
---|---|
abstract void |
finishHandshake(Channel channel,
HttpResponse response)
Validates and finishes the opening handshake initiated by
handshake(org.jboss.netty.channel.Channel) }. |
java.lang.String |
getActualSubprotocol()
Returns the subprotocol response sent by the server.
|
java.lang.String |
getExpectedSubprotocol()
Returns the CSV of requested subprotocol(s) sent to the server as specified in the constructor
|
long |
getMaxFramePayloadLength()
Returns the max length for any frame's payload
|
WebSocketVersion |
getVersion()
Version of the web socket specification that is being used
|
java.net.URI |
getWebSocketUrl()
Returns the URI to the web socket. e.g.
|
abstract ChannelFuture |
handshake(Channel channel)
Begins the opening handshake
|
boolean |
isHandshakeComplete()
Flag to indicate if the opening handshake is complete
|
protected void |
setActualSubprotocol(java.lang.String actualSubprotocol) |
protected void |
setHandshakeComplete() |
protected WebSocketClientHandshaker(java.net.URI webSocketUrl, WebSocketVersion version, java.lang.String subprotocol, java.util.Map<java.lang.String,java.lang.String> customHeaders)
webSocketUrl
- URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be
sent to this URL.version
- Version of web socket specification to use to connect to the serversubprotocol
- Sub protocol request sent to the server.customHeaders
- Map of custom headers to add to the client requestprotected WebSocketClientHandshaker(java.net.URI webSocketUrl, WebSocketVersion version, java.lang.String subprotocol, java.util.Map<java.lang.String,java.lang.String> customHeaders, long maxFramePayloadLength)
webSocketUrl
- URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be
sent to this URL.version
- Version of web socket specification to use to connect to the serversubprotocol
- CSV of requested subprotocol(s) sent to the server.customHeaders
- Map of custom headers to add to the client requestmaxFramePayloadLength
- Maximum length of a frame's payloadpublic java.net.URI getWebSocketUrl()
public WebSocketVersion getVersion()
public long getMaxFramePayloadLength()
public boolean isHandshakeComplete()
protected void setHandshakeComplete()
public java.lang.String getExpectedSubprotocol()
public java.lang.String getActualSubprotocol()
protected void setActualSubprotocol(java.lang.String actualSubprotocol)
public abstract ChannelFuture handshake(Channel channel) throws java.lang.Exception
channel
- Channeljava.lang.Exception
public abstract void finishHandshake(Channel channel, HttpResponse response)
handshake(org.jboss.netty.channel.Channel)
}.channel
- Channelresponse
- HTTP response containing the closing handshake details