public abstract class WebSocketServerHandshaker extends Object
Modifier | Constructor and Description |
---|---|
protected |
WebSocketServerHandshaker(WebSocketVersion version,
String webSocketUrl,
String subprotocols,
int maxFramePayloadLength)
Constructor specifying the destination web socket location
|
Modifier and Type | Method and Description |
---|---|
abstract io.netty.channel.ChannelFuture |
close(io.netty.channel.Channel channel,
CloseWebSocketFrame frame)
Performs the closing handshake
|
int |
getMaxFramePayloadLength()
Gets the maximum length for any frame's payload.
|
String |
getSelectedSubprotocol()
Returns the selected subprotocol.
|
Set<String> |
getSubprotocols()
Returns the CSV of supported sub protocols
|
WebSocketVersion |
getVersion()
Returns the version of the specification being supported
|
String |
getWebSocketUrl()
Returns the URL of the web socket
|
abstract io.netty.channel.ChannelFuture |
handshake(io.netty.channel.Channel channel,
HttpRequest req)
Performs the opening handshake
|
protected String |
selectSubprotocol(String requestedSubprotocols)
Selects the first matching supported sub protocol
|
protected void |
setSelectedSubprotocol(String value) |
protected WebSocketServerHandshaker(WebSocketVersion version, String webSocketUrl, String subprotocols, int maxFramePayloadLength)
version
- the protocol versionwebSocketUrl
- URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be
sent to this URL.subprotocols
- CSV of supported protocols. Null if sub protocols not supported.maxFramePayloadLength
- Maximum length of a frame's payloadpublic String getWebSocketUrl()
public WebSocketVersion getVersion()
public int getMaxFramePayloadLength()
public abstract io.netty.channel.ChannelFuture handshake(io.netty.channel.Channel channel, HttpRequest req)
channel
- Channelreq
- HTTP Requestpublic abstract io.netty.channel.ChannelFuture close(io.netty.channel.Channel channel, CloseWebSocketFrame frame)
channel
- Channelframe
- Closing Frame that was receivedprotected String selectSubprotocol(String requestedSubprotocols)
requestedSubprotocols
- CSV of protocols to be supported. e.g. "chat, superchat"public String getSelectedSubprotocol()
This is only available AFTER handshake() has been called.
protected void setSelectedSubprotocol(String value)
Copyright © 2008-2012 The Netty Project. All Rights Reserved.