public abstract class SockJSSocket extends java.lang.Object implements ReadStream, WriteStream
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 | Field and Description |
---|---|
static java.util.concurrent.atomic.AtomicInteger |
cnt |
protected Vertx |
vertx |
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 . |
Modifier | Constructor and Description |
---|---|
protected |
SockJSSocket(Vertx vertx) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
finalize() |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dataHandler, endHandler, exceptionHandler, pause, resume
drainHandler, exceptionHandler, setWriteQueueMaxSize, writeBuffer, writeQueueFull
protected final Vertx vertx
public final 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.
public static java.util.concurrent.atomic.AtomicInteger cnt
protected SockJSSocket(Vertx vertx)