public abstract class Handshake extends Object
Sample (Draft06) client => server GET /chat HTTP/1.1 Host: server.example.com Upgrade: websocket Connection: Upgrade Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ== Sec-WebSocket-Origin: http://example.com Sec-WebSocket-Protocol: chat, superchat Sec-WebSocket-Version:6 server => client HTTP/1.1 101 Switching Protocols Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo= Sec-WebSocket-Protocol: chat
| Modifier and Type | Field and Description |
|---|---|
protected BufferManager |
bufferManager
The buffer manager.
|
| Constructor and Description |
|---|
Handshake() |
| Modifier and Type | Method and Description |
|---|---|
abstract ByteBuffer |
createHandshakeRequest()
Creates the handshake request.
|
protected boolean |
done()
Done.
|
HttpHeader |
getResponseHeader()
Gets the response header map.
|
int |
getResponseStatus()
Gets the response status.
|
boolean |
handshakeResponse(ByteBuffer downloadBuffer)
Handshake response.
|
boolean |
isDone()
Checks if is done.
|
protected boolean |
parseHandshakeResponseBody(ByteBuffer buffer)
Parses the handshake response contents.
|
protected boolean |
parseHandshakeResponseHeader(ByteBuffer buffer)
Parses the handshake response header.
|
protected com.taobao.api.internal.toplink.embedded.websocket.handshake.Handshake.State |
state()
State.
|
protected com.taobao.api.internal.toplink.embedded.websocket.handshake.Handshake.State |
transitionTo(com.taobao.api.internal.toplink.embedded.websocket.handshake.Handshake.State to)
Transition to.
|
protected BufferManager bufferManager
protected com.taobao.api.internal.toplink.embedded.websocket.handshake.Handshake.State transitionTo(com.taobao.api.internal.toplink.embedded.websocket.handshake.Handshake.State to)
to - the toprotected com.taobao.api.internal.toplink.embedded.websocket.handshake.Handshake.State state()
public final boolean handshakeResponse(ByteBuffer downloadBuffer) throws WebSocketException
downloadBuffer - the download bufferWebSocketException - the web socket exceptionprotected boolean done()
public boolean isDone()
protected boolean parseHandshakeResponseBody(ByteBuffer buffer) throws WebSocketException
buffer - the bufferWebSocketException - the web socket exceptionprotected boolean parseHandshakeResponseHeader(ByteBuffer buffer) throws WebSocketException
buffer - the bufferWebSocketException - the web socket exceptionpublic abstract ByteBuffer createHandshakeRequest() throws WebSocketException
WebSocketException - the web socket exceptionpublic int getResponseStatus()
public HttpHeader getResponseHeader()
Copyright © 2021. All rights reserved.