public abstract class WebSocketClientHandshaker extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<String,String> |
customHeaders |
Constructor and Description |
---|
WebSocketClientHandshaker(URI webSocketUrl,
WebSocketVersion version,
String subprotocol,
Map<String,String> customHeaders,
int maxFramePayloadLength)
Base constructor
|
Modifier and Type | Method and Description |
---|---|
abstract void |
finishHandshake(io.netty.channel.Channel channel,
HttpResponse response)
Validates and finishes the opening handshake initiated by
handshake(io.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
|
int |
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 io.netty.channel.ChannelFuture |
handshake(io.netty.channel.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() |
public WebSocketClientHandshaker(URI webSocketUrl, WebSocketVersion version, String subprotocol, Map<String,String> customHeaders, int 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
- Sub protocol request 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 int getMaxFramePayloadLength()
public boolean isHandshakeComplete()
protected void setHandshakeComplete()
public String getExpectedSubprotocol()
public String getActualSubprotocol()
protected void setActualSubprotocol(String actualSubprotocol)
public abstract io.netty.channel.ChannelFuture handshake(io.netty.channel.Channel channel)
channel
- Channelpublic abstract void finishHandshake(io.netty.channel.Channel channel, HttpResponse response)
handshake(io.netty.channel.Channel)
}.channel
- Channelresponse
- HTTP response containing the closing handshake detailsCopyright © 2008-2012 The Netty Project. All Rights Reserved.