public interface SockJSSocket extends ReadStream<SockJSSocket>, WriteStream<SockJSSocket>
The API is very similar to WebSocket
.
It implements 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.
Modifier and Type | Method and Description |
---|---|
void |
close()
Close it
|
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
|
java.net.InetSocketAddress |
localAddress()
Return the local address for this socket
|
java.net.InetSocketAddress |
remoteAddress()
Return the remote address for this socket
|
java.lang.String |
uri()
Return the URI corresponding to the last request for this socket or the websocket handshake
|
java.lang.String |
writeHandlerID()
When a
SockJSSocket is created it automatically registers an event handler with the event bus, the ID of that
handler is given by writeHandlerID . |
endHandler
dataHandler, pause, resume
exceptionHandler
write
drainHandler, setWriteQueueMaxSize, writeQueueFull
java.lang.String writeHandlerID()
SockJSSocket
is created it automatically registers an event handler with the event bus, the ID of that
handler is given by writeHandlerID
.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.
void close()
java.net.InetSocketAddress remoteAddress()
java.net.InetSocketAddress localAddress()
MultiMap headers()
java.lang.String uri()