public abstract class Draft extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
protected Opcode |
continuousFrameType |
protected Role |
role
In some cases the handshake will be parsed different depending on whether
|
| 构造器和说明 |
|---|
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, IncompleteHandshakeException
public abstract HandshakeState acceptHandshakeAsClient(ClientHandshake request, ServerHandshake response) throws InvalidHandshakeException
public abstract HandshakeState acceptHandshakeAsServer(ClientHandshake handshakedata) throws 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()
public List<ByteBuffer> createHandshake(Handshakedata handshakedata, Role ownrole)
public List<ByteBuffer> createHandshake(Handshakedata handshakedata, Role ownrole, boolean withcontent)
public abstract ClientHandshakeBuilder postProcessHandshakeRequestAsClient(ClientHandshakeBuilder request) throws InvalidHandshakeException
public abstract HandshakeBuilder postProcessHandshakeResponseAsServer(ClientHandshake request, ServerHandshakeBuilder response) throws InvalidHandshakeException
public abstract List<Framedata> translateFrame(ByteBuffer buffer) throws InvalidDataException
public abstract CloseHandshakeType getCloseHandshakeType()
public abstract Draft copyInstance()
public Handshakedata translateHandshake(ByteBuffer buf) throws InvalidHandshakeException
public int checkAlloc(int bytecount)
throws LimitExedeedException,
InvalidDataException
public void setParseMode(Role role)
public Role getRole()
public String getCharset()
public void setCharset(String charset)
charset - value to be assigned to property charsetCopyright © 2025. All rights reserved.