public abstract class WebSocketClientHandshaker extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<String,String> |
customHeaders |
Modifier | Constructor and Description |
---|---|
protected |
WebSocketClientHandshaker(URI webSocketUrl,
WebSocketVersion version,
String subprotocol,
Map<String,String> customHeaders)
Base constructor with default values
|
protected |
WebSocketClientHandshaker(URI webSocketUrl,
WebSocketVersion version,
String subprotocol,
Map<String,String> customHeaders,
long maxFramePayloadLength)
Base constructor
|
Modifier and Type | Method and Description |
---|---|
abstract void |
finishHandshake(Channel channel,
HttpResponse response)
Validates and finishes the opening handshake initiated by
handshake(org.jboss.netty.channel.Channel) }. |
String |
getActualSubprotocol()
Returns the subprotocol response sent by the server.
|
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
|
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(String actualSubprotocol) |
protected void |
setHandshakeComplete() |
protected WebSocketClientHandshaker(URI webSocketUrl, WebSocketVersion version, String subprotocol, Map<String,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(URI webSocketUrl, WebSocketVersion version, String subprotocol, Map<String,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 URI getWebSocketUrl()
public WebSocketVersion getVersion()
public long getMaxFramePayloadLength()
public boolean isHandshakeComplete()
protected void setHandshakeComplete()
public String getExpectedSubprotocol()
public String getActualSubprotocol()
protected void setActualSubprotocol(String actualSubprotocol)
public abstract ChannelFuture handshake(Channel channel) throws Exception
channel
- ChannelException
public abstract void finishHandshake(Channel channel, HttpResponse response)
handshake(org.jboss.netty.channel.Channel)
}.channel
- Channelresponse
- HTTP response containing the closing handshake detailsCopyright © 2008-2014 The Netty Project. All Rights Reserved.