You interact with SockJS clients through instances of SockJS socket.
The API is very similar to io.vertx.core.http.WebSocket
.
It implements both and
so it can be used with
io.vertx.core.streams.Pump
to pump data with flow control.
Anything
SockJSSocket
Basic
Identifiable
Object
Anything
ReadStream
StreamBase
WriteStream
StreamBase
no subtypes hierarchy
Initializer |
SockJSSocket(SockJSSocket unknown) |
Inherited Attributes |
Attributes inherited from: Object hash , string |
Methods | |
close | shared default void close() Close it |
drainHandler | shared actual default SockJSSocket drainHandler(Anything() handler) Set a drain handler on the stream. If the write queue is full, then the handler will be called when the write queue is ready to accept buffers again. See Pump for an example of this being used. The stream implementation defines when the drain handler, for example it could be when the queue size has been reduced tomaxSize / 2 .
Refines WriteStream.drainHandler |
end | shared actual default void end() Call end. Refines WriteStream.end |
end | shared actual default void end(Buffer t) |
endHandler | shared actual default SockJSSocket endHandler(Anything() endHandler) Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called. Refines ReadStream.endHandler |
exceptionHandler | shared actual default SockJSSocket exceptionHandler(Anything(Throwable) handler) Set an exception handler. Refines StreamBase.exceptionHandler |
handler | shared actual default SockJSSocket handler(Anything(Buffer) handler) Set a data handler. As data is read, the handler will be called with the data. Refines ReadStream.handler |
headers | shared default MultiMap headers() Return the headers corresponding to the last request for this socket or the websocket handshake Any cookie headers will be removed for security reasons |
localAddress | shared default SocketAddress localAddress() Return the local address for this socket |
pause | shared actual default SockJSSocket pause() Pause the Refines ReadStream.pause |
remoteAddress | shared default SocketAddress remoteAddress() Return the remote address for this socket |
resume | shared actual default SockJSSocket resume() Resume reading. If the Refines ReadStream.resume |
setWriteQueueMaxSize | shared actual default SockJSSocket setWriteQueueMaxSize(Integer maxSize) Set the maximum size of the write queue to Refines WriteStream.setWriteQueueMaxSize |
uri | shared default String uri() Return the URI corresponding to the last request for this socket or the websocket handshake |
webSession | shared default Session? webSession() |
webUser | shared default User? webUser() |
write | shared actual default SockJSSocket write(Buffer data) |
write | shared default SockJSSocket write(String data) Write a Parameters:
|
writeHandlerID | shared default String writeHandlerID() When a Given this ID, a different event loop can send a buffer 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 socket. This allows you to write data to other sockets which are owned by different event loops. |
writeQueueFull | shared actual default Boolean writeQueueFull() This will return Refines WriteStream.writeQueueFull |
Inherited Methods |
Methods inherited from: Object equals |
Methods inherited from: ReadStream<T> endHandler , exceptionHandler , handler , pause , resume |
Methods inherited from: StreamBase exceptionHandler |
Methods inherited from: WriteStream<T> drainHandler , end , exceptionHandler , setWriteQueueMaxSize , write , writeQueueFull |