public abstract class Draft extends Object
Modifier and Type | Field and Description |
---|---|
protected Opcode |
continuousFrameType |
protected Role |
role
In some cases the handshake will be parsed different depending on whether
|
Constructor and Description |
---|
Draft() |
protected Role role
protected Opcode continuousFrameType
public static ByteBuffer readLine(ByteBuffer buf)
public static String readStringLine(ByteBuffer buf)
public static HandshakeBuilder translateHandshakeHttp(ByteBuffer buf, Role role) throws InvalidHandshakeException
InvalidHandshakeException
public abstract HandshakeState acceptHandshakeAsClient(ClientHandshake request, ServerHandshake response) throws InvalidHandshakeException
InvalidHandshakeException
public abstract 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(Opcode op, ByteBuffer buffer, boolean fin)
public abstract void reset()
@Deprecated public List<ByteBuffer> createHandshake(Handshakedata handshakedata, Role ownrole)
public List<ByteBuffer> createHandshake(Handshakedata handshakedata)
@Deprecated public List<ByteBuffer> createHandshake(Handshakedata handshakedata, Role ownrole, boolean withcontent)
public List<ByteBuffer> createHandshake(Handshakedata handshakedata, 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 CloseHandshakeType getCloseHandshakeType()
public abstract Draft copyInstance()
public Handshakedata translateHandshake(ByteBuffer buf) throws InvalidHandshakeException
InvalidHandshakeException
public int checkAlloc(int bytecount) throws InvalidDataException
InvalidDataException
public void setParseMode(Role role)
public Role getRole()
Copyright © 2021. All rights reserved.