Skip to content
Marcel Prestel edited this page Oct 4, 2017 · 18 revisions

Overview

The WebSocket protocol has been evolving since 2009. The different specifications have different features which are incompatible with each other.
For every protocol version that affects the way bytes are transfered there is a corresponding class derived from Draft. The protocol version implementaions will be referenced to as drafts from now onwards.

The WebSocketServer detects any draft of a connecting client by default.
The WebSocketClient on the other hand is the one who initiates the connection and therefore has to decide which draft to use.

By enabling the debug mode ( WebSocketImpl.DEBUG = true;) the used Draft(s) will show up in the console(std::out).

Draft

Draft is the base class for everything of a websocket specification which is not common such as the way the handshake is read or frames are transfered.

Draft_6455

Draft_6455 implements RFC 6455. Since this protocol version made it into an RFC state it is expected to last longer than a month.
This is the recommended draft!

Important note

If you extend from Draft_6455 or develop your own draft, you MUST overwrite the following methods: hashCode(), equals() and copyInstance()