public abstract class Draft extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Draft.CloseHandshakeType
Enum which represents type of handshake is required for a close
|
static class |
Draft.HandshakeState
Enum which represents the states a handshake may be in
|
Modifier and Type | Field and Description |
---|---|
protected Framedata.Opcode |
continuousFrameType |
static byte[] |
FLASH_POLICY_REQUEST |
static int |
INITIAL_FAMESIZE |
static int |
MAX_FAME_SIZE |
protected WebSocket.Role |
role
In some cases the handshake will be parsed different depending on whether
|
Constructor and Description |
---|
Draft() |
public static int MAX_FAME_SIZE
public static int INITIAL_FAMESIZE
public static final byte[] FLASH_POLICY_REQUEST
protected WebSocket.Role role
protected Framedata.Opcode continuousFrameType
public static ByteBuffer readLine(ByteBuffer buf)
public static String readStringLine(ByteBuffer buf)
public static HandshakeBuilder translateHandshakeHttp(ByteBuffer buf, WebSocket.Role role) throws InvalidHandshakeException, IncompleteHandshakeException
public abstract Draft.HandshakeState acceptHandshakeAsClient(ClientHandshake request, ServerHandshake response) throws InvalidHandshakeException
InvalidHandshakeException
public abstract Draft.HandshakeState acceptHandshakeAsServer(ClientHandshake handshakedata) throws InvalidHandshakeException
InvalidHandshakeException
protected boolean basicAccept(Handshakedata handshakedata)
public abstract ByteBuffer createBinaryFrame(Framedata framedata)
public abstract List<Framedata> createFrames(ByteBuffer binary, boolean mask)
public abstract void processFrame(WebSocketImpl webSocketImpl, Framedata frame) throws InvalidDataException
webSocketImpl
- the websocketimpl used for this draftframe
- the frame which is supposed to be handledInvalidDataException
- will be thrown on invalid datapublic List<Framedata> continuousFrame(Framedata.Opcode op, ByteBuffer buffer, boolean fin)
public abstract void reset()
public List<ByteBuffer> createHandshake(Handshakedata handshakedata, WebSocket.Role ownrole)
public List<ByteBuffer> createHandshake(Handshakedata handshakedata, WebSocket.Role ownrole, boolean withcontent)
public abstract ClientHandshakeBuilder postProcessHandshakeRequestAsClient(ClientHandshakeBuilder request) throws InvalidHandshakeException
InvalidHandshakeException
public abstract HandshakeBuilder postProcessHandshakeResponseAsServer(ClientHandshake request, ServerHandshakeBuilder response) throws InvalidHandshakeException
InvalidHandshakeException
public abstract List<Framedata> translateFrame(ByteBuffer buffer) throws InvalidDataException
InvalidDataException
public abstract Draft.CloseHandshakeType getCloseHandshakeType()
public abstract Draft copyInstance()
public Handshakedata translateHandshake(ByteBuffer buf) throws InvalidHandshakeException
InvalidHandshakeException
public int checkAlloc(int bytecount) throws LimitExedeedException, InvalidDataException
public void setParseMode(WebSocket.Role role)
public WebSocket.Role getRole()
Copyright © 2017. All rights reserved.