Represents an HTML 5 Websocket
Instances of this class are created and provided to the handler of an
HttpClient
when a successful websocket connect attempt occurs.
On the server side, the subclass ServerWebSocket
is used instead.
It provides access to both ReadStream
and WriteStream
so
it can be used with Pump
to pump data with flow control.
Instances of this class are not thread-safe
Anything
Object
WebSocketBase
Basic
Identifiable
Object
Anything
Initializer |
WebSocketBase(WebSocketBase<out Object> delegate) |
Attributes | |
binaryHandlerId | shared String binaryHandlerId= delegate.binaryHandlerID() When a Given this ID, a different event loop can send a binary frame to that event handler using the event bus and that buffer will be received by this instance in its own event loop and written to the underlying connection. This allows you to write data to other websockets which are owned by different event loops. |
localAddress | shared SocketAddress localAddress Return the local address for this socket |
readStream | shared ReadStream readStream |
remoteAddress | shared SocketAddress remoteAddress Return the remote address for this socket |
textHandlerID | shared String textHandlerID= delegate.textHandlerID() When a Given this ID, a different event loop can send a text frame to that event handler using the event bus and that buffer will be received by this instance in its own event loop and written to the underlying connection. This allows you to write data to other websockets which are owned by different event loops. |
writeStream | shared WriteStream writeStream |
Inherited Attributes |
Attributes inherited from: Object hash , string |
Methods | |
close | shared void close() Close the websocket |
closeHandler | shared Promise<Anything> closeHandler() |
frameHandler | shared WebSocketBase frameHandler(void onFrame(WebSocketFrame frame)) Set a frame handler on the connection |
writeBinaryFrame | shared WebSocketBase writeBinaryFrame(Buffer buffer) Write |
writeTextFrame | shared WebSocketBase writeTextFrame(String str) Write |
Inherited Methods |
Methods inherited from: Object equals |