-
public class Draft_6455 extends Draft
Implementation for the RFC 6455 websocket protocol This is the recommended class for your websocket connection
-
-
Field Summary
Fields Modifier and Type Field Description private IExtension
extension
private List<IExtension>
knownExtensions
private IProtocol
protocol
private List<IProtocol>
knownProtocols
private int
maxFrameSize
-
Constructor Summary
Constructors Constructor Description Draft_6455()
Constructor for the websocket protocol specified by RFC 6455 with default extensions Draft_6455(IExtension inputExtension)
Constructor for the websocket protocol specified by RFC 6455 with custom extensions Draft_6455(List<IExtension> inputExtensions)
Constructor for the websocket protocol specified by RFC 6455 with custom extensions Draft_6455(List<IExtension> inputExtensions, List<IProtocol> inputProtocols)
Constructor for the websocket protocol specified by RFC 6455 with custom extensions andprotocols Draft_6455(List<IExtension> inputExtensions, int inputMaxFrameSize)
Constructor for the websocket protocol specified by RFC 6455 with custom extensions andprotocols Draft_6455(List<IExtension> inputExtensions, List<IProtocol> inputProtocols, int inputMaxFrameSize)
Constructor for the websocket protocol specified by RFC 6455 with custom extensions andprotocols
-
Method Summary
-
Methods inherited from class com.tds.common.websocket.drafts.Draft
acceptHandshakeAsClient, checkAlloc, continuousFrame, createHandshake, createHandshake, createHandshake, createHandshake, getRole, postProcessHandshakeResponseAsServer, readLine, readStringLine, setParseMode, translateHandshake, translateHandshakeHttp
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
Draft_6455
Draft_6455()
Constructor for the websocket protocol specified by RFC 6455 with default extensions
-
Draft_6455
Draft_6455(IExtension inputExtension)
Constructor for the websocket protocol specified by RFC 6455 with custom extensions- Parameters:
inputExtension
- the extension which should be used for this draft
-
Draft_6455
Draft_6455(List<IExtension> inputExtensions)
Constructor for the websocket protocol specified by RFC 6455 with custom extensions- Parameters:
inputExtensions
- the extensions which should be used for this draft
-
Draft_6455
Draft_6455(List<IExtension> inputExtensions, List<IProtocol> inputProtocols)
Constructor for the websocket protocol specified by RFC 6455 with custom extensions andprotocols- Parameters:
inputExtensions
- the extensions which should be used for this draftinputProtocols
- the protocols which should be used for this draft
-
Draft_6455
Draft_6455(List<IExtension> inputExtensions, int inputMaxFrameSize)
Constructor for the websocket protocol specified by RFC 6455 with custom extensions andprotocols- Parameters:
inputExtensions
- the extensions which should be used for this draftinputMaxFrameSize
- the maximum allowed size of a frame (the real payload size, decodedframes can be bigger)
-
Draft_6455
Draft_6455(List<IExtension> inputExtensions, List<IProtocol> inputProtocols, int inputMaxFrameSize)
Constructor for the websocket protocol specified by RFC 6455 with custom extensions andprotocols- Parameters:
inputExtensions
- the extensions which should be used for this draftinputProtocols
- the protocols which should be used for this draftinputMaxFrameSize
- the maximum allowed size of a frame (the real payload size, decodedframes can be bigger)
-
-
Method Detail
-
getExtension
IExtension getExtension()
Getter for the extension which is used by this draft
-
getKnownExtensions
List<IExtension> getKnownExtensions()
Getter for all available extensions for this draft
-
getProtocol
IProtocol getProtocol()
Getter for the protocol which is used by this draft
-
getKnownProtocols
List<IProtocol> getKnownProtocols()
Getter for all available protocols for this draft
-
getMaxFrameSize
int getMaxFrameSize()
Getter for the maximum allowed payload size which is used by this draft
-
acceptHandshakeAsServer
HandshakeState acceptHandshakeAsServer(ClientHandshake handshakedata)
-
acceptHandshakeAsClient
HandshakeState acceptHandshakeAsClient(ClientHandshake request, ServerHandshake response)
-
postProcessHandshakeRequestAsClient
ClientHandshakeBuilder postProcessHandshakeRequestAsClient(ClientHandshakeBuilder request)
-
postProcessHandshakeResponseAsServer
HandshakeBuilder postProcessHandshakeResponseAsServer(ClientHandshake request, ServerHandshakeBuilder response)
-
copyInstance
Draft copyInstance()
Drafts must only be by one websocket at all. To prevent drafts to be used more than once theWebsocket implementation should call this method in order to create a new usable version of agiven draft instance. The copy can be safely used in conjunction with a new websocketconnection.
-
createBinaryFrame
ByteBuffer createBinaryFrame(Framedata framedata)
-
translateFrame
List<Framedata> translateFrame(ByteBuffer buffer)
-
createFrames
List<Framedata> createFrames(ByteBuffer binary, boolean mask)
-
createFrames
List<Framedata> createFrames(String text, boolean mask)
-
reset
void reset()
-
processFrame
void processFrame(WebSocketImpl webSocketImpl, Framedata frame)
Handle the frame specific to the draft
- Parameters:
webSocketImpl
- the websocketimpl used for this draftframe
- the frame which is supposed to be handled
-
getCloseHandshakeType
CloseHandshakeType getCloseHandshakeType()
-
hashCode
int hashCode()
-
-
-
-