public class ClientWebSocket extends WebSocket
original
non RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<ClientWebSocket> |
__TYPE_ARG |
Constructor and Description |
---|
ClientWebSocket(ClientWebSocket delegate) |
ClientWebSocket(Object delegate) |
Modifier and Type | Method and Description |
---|---|
String |
binaryHandlerID()
When a
WebSocket is created, it may register an event handler with the event bus - the ID of that
handler is given by this method. |
ClientWebSocket |
binaryMessageHandler(Handler<Buffer> handler)
Set a binary message handler on the connection.
|
void |
close()
Same as
WebSocketBase.close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
void |
close(Handler<AsyncResult<Void>> handler)
Same as
WebSocketBase.close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
void |
close(short statusCode)
Same as
WebSocketBase.close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
void |
close(short statusCode,
Handler<AsyncResult<Void>> handler)
Same as
WebSocketBase.close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
void |
close(short statusCode,
String reason)
Same as
WebSocketBase.close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
void |
close(short statusCode,
String reason,
Handler<AsyncResult<Void>> handler)
Same as
WebSocketBase.close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
ClientWebSocket |
closeHandler(Handler<Void> handler)
Set a close handler.
|
String |
closeReason()
Returns the close reason message from the remote endpoint or
null when not yet received. |
Short |
closeStatusCode()
Returns the close status code received from the remote endpoint or
null when not yet received. |
void |
connect(int port,
String host,
String requestURI)
Connect a WebSocket to the specified port, host and relative request URI
|
void |
connect(int port,
String host,
String requestURI,
Handler<AsyncResult<WebSocket>> handler)
Connect a WebSocket to the specified port, host and relative request URI
|
void |
connect(String requestURI)
Connect this WebSocket at the relative request URI using the default host and port.
|
void |
connect(String requestURI,
Handler<AsyncResult<WebSocket>> handler)
Connect this WebSocket at the relative request URI using the default host and port.
|
void |
connect(String host,
String requestURI)
Connect this WebSocket to the host and relative request URI and default port.
|
void |
connect(String host,
String requestURI,
Handler<AsyncResult<WebSocket>> handler)
Connect this WebSocket to the host and relative request URI and default port.
|
void |
connect(WebSocketConnectOptions options)
Connect a WebSocket with the specified options.
|
void |
connect(WebSocketConnectOptions options,
Handler<AsyncResult<WebSocket>> handler)
Connect a WebSocket with the specified options.
|
ClientWebSocket |
drainHandler(Handler<Void> handler)
Set a drain handler on the stream.
|
void |
end()
|
void |
end(Buffer data)
Same as but with an
handler called when the operation completes |
void |
end(Buffer data,
Handler<AsyncResult<Void>> handler)
Same as but with an
handler called when the operation completes |
void |
end(Handler<AsyncResult<Void>> handler)
|
ClientWebSocket |
endHandler(Handler<Void> endHandler)
Set an end handler.
|
boolean |
equals(Object o) |
ClientWebSocket |
exceptionHandler(Handler<Throwable> handler)
Set an exception handler on the read stream.
|
ClientWebSocket |
frameHandler(Handler<WebSocketFrame> handler)
Set a frame handler on the connection.
|
ClientWebSocket |
getDelegate() |
ClientWebSocket |
handler(Handler<Buffer> handler)
Set a data handler.
|
int |
hashCode() |
MultiMap |
headers()
Returns the HTTP headers when the WebSocket is first obtained in the handler.
|
boolean |
isClosed() |
boolean |
isSsl() |
SocketAddress |
localAddress() |
static ClientWebSocket |
newInstance(ClientWebSocket arg) |
Pipe<Buffer> |
pipe()
Pause this stream and return a to transfer the elements of this stream to a destination .
|
void |
pipeTo(WriteStream<Buffer> dst)
Pipe this
ReadStream to the WriteStream . |
void |
pipeTo(WriteStream<Buffer> dst,
Handler<AsyncResult<Void>> handler)
Pipe this
ReadStream to the WriteStream . |
ClientWebSocket |
pongHandler(Handler<Buffer> handler)
Set a pong frame handler on the connection.
|
SocketAddress |
remoteAddress() |
Single<Void> |
rxClose()
Same as
WebSocketBase.close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
Single<Void> |
rxClose(short statusCode)
Same as
WebSocketBase.close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
Single<Void> |
rxClose(short statusCode,
String reason)
Same as
WebSocketBase.close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
Single<WebSocket> |
rxConnect(int port,
String host,
String requestURI)
Connect a WebSocket to the specified port, host and relative request URI
|
Single<WebSocket> |
rxConnect(String requestURI)
Connect this WebSocket at the relative request URI using the default host and port.
|
Single<WebSocket> |
rxConnect(String host,
String requestURI)
Connect this WebSocket to the host and relative request URI and default port.
|
Single<WebSocket> |
rxConnect(WebSocketConnectOptions options)
Connect a WebSocket with the specified options.
|
Single<Void> |
rxEnd()
|
Single<Void> |
rxEnd(Buffer data)
Same as but with an
handler called when the operation completes |
Single<Void> |
rxPipeTo(WriteStream<Buffer> dst)
Pipe this
ReadStream to the WriteStream . |
Single<Void> |
rxWrite(Buffer data)
Same as but with an
handler called when the operation completes |
Single<Void> |
rxWriteBinaryMessage(Buffer data)
Same as
WebSocketBase.writeBinaryMessage(io.vertx.rxjava.core.buffer.Buffer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
Single<Void> |
rxWriteFinalBinaryFrame(Buffer data)
Same as
WebSocketBase.writeFinalBinaryFrame(io.vertx.rxjava.core.buffer.Buffer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
Single<Void> |
rxWriteFinalTextFrame(String text)
Same as
WebSocketBase.writeFinalTextFrame(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
Single<Void> |
rxWriteFrame(WebSocketFrame frame)
Same as
WebSocketBase.writeFrame(io.vertx.rxjava.core.http.WebSocketFrame, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
Single<Void> |
rxWritePing(Buffer data)
Writes a ping frame to the connection.
|
Single<Void> |
rxWritePong(Buffer data)
Writes a pong frame to the connection.
|
Single<Void> |
rxWriteTextMessage(String text)
Same as
WebSocketBase.writeTextMessage(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
SSLSession |
sslSession() |
String |
subProtocol()
Returns the WebSocket sub protocol selected by the WebSocket handshake.
|
String |
textHandlerID()
When a
WebSocket is created, it may register an event handler with the eventbus, the ID of that
handler is given by textHandlerID . |
ClientWebSocket |
textMessageHandler(Handler<String> handler)
Set a text message handler on the connection.
|
Observable<Buffer> |
toObservable() |
String |
toString() |
WriteStreamSubscriber<Buffer> |
toSubscriber() |
void |
write(Buffer data)
Same as but with an
handler called when the operation completes |
void |
write(Buffer data,
Handler<AsyncResult<Void>> handler)
Same as but with an
handler called when the operation completes |
ClientWebSocket |
writeBinaryMessage(Buffer data)
Same as
WebSocketBase.writeBinaryMessage(io.vertx.rxjava.core.buffer.Buffer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
ClientWebSocket |
writeBinaryMessage(Buffer data,
Handler<AsyncResult<Void>> handler)
Same as
WebSocketBase.writeBinaryMessage(io.vertx.rxjava.core.buffer.Buffer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
ClientWebSocket |
writeFinalBinaryFrame(Buffer data)
Same as
WebSocketBase.writeFinalBinaryFrame(io.vertx.rxjava.core.buffer.Buffer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
ClientWebSocket |
writeFinalBinaryFrame(Buffer data,
Handler<AsyncResult<Void>> handler)
Same as
WebSocketBase.writeFinalBinaryFrame(io.vertx.rxjava.core.buffer.Buffer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
ClientWebSocket |
writeFinalTextFrame(String text)
Same as
WebSocketBase.writeFinalTextFrame(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
ClientWebSocket |
writeFinalTextFrame(String text,
Handler<AsyncResult<Void>> handler)
Same as
WebSocketBase.writeFinalTextFrame(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
ClientWebSocket |
writeFrame(WebSocketFrame frame)
Same as
WebSocketBase.writeFrame(io.vertx.rxjava.core.http.WebSocketFrame, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
ClientWebSocket |
writeFrame(WebSocketFrame frame,
Handler<AsyncResult<Void>> handler)
Same as
WebSocketBase.writeFrame(io.vertx.rxjava.core.http.WebSocketFrame, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
ClientWebSocket |
writePing(Buffer data)
Writes a ping frame to the connection.
|
ClientWebSocket |
writePing(Buffer data,
Handler<AsyncResult<Void>> handler)
Writes a ping frame to the connection.
|
ClientWebSocket |
writePong(Buffer data)
Writes a pong frame to the connection.
|
ClientWebSocket |
writePong(Buffer data,
Handler<AsyncResult<Void>> handler)
Writes a pong frame to the connection.
|
boolean |
writeQueueFull()
This will return
true if there are more bytes in the write queue than the value set using WebSocket.setWriteQueueMaxSize(int) |
ClientWebSocket |
writeTextMessage(String text)
Same as
WebSocketBase.writeTextMessage(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
ClientWebSocket |
writeTextMessage(String text,
Handler<AsyncResult<Void>> handler)
Same as
WebSocketBase.writeTextMessage(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
fetch, newInstance, pause, resume, setWriteQueueMaxSize
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
newInstance
newInstance, newInstance
newInstance, newInstance
newInstance
public static final io.vertx.lang.rx.TypeArg<ClientWebSocket> __TYPE_ARG
public ClientWebSocket(ClientWebSocket delegate)
public ClientWebSocket(Object delegate)
public ClientWebSocket getDelegate()
getDelegate
in interface WebSocketBase
getDelegate
in interface ReadStream<Buffer>
getDelegate
in interface StreamBase
getDelegate
in interface WriteStream<Buffer>
getDelegate
in class WebSocket
public Observable<Buffer> toObservable()
toObservable
in interface ReadStream<Buffer>
toObservable
in class WebSocket
public WriteStreamSubscriber<Buffer> toSubscriber()
toSubscriber
in interface WriteStream<Buffer>
toSubscriber
in class WebSocket
public void write(Buffer data, Handler<AsyncResult<Void>> handler)
handler
called when the operation completeswrite
in interface WebSocketBase
write
in interface WriteStream<Buffer>
write
in class WebSocket
data
- handler
- public void write(Buffer data)
handler
called when the operation completeswrite
in interface WebSocketBase
write
in interface WriteStream<Buffer>
write
in class WebSocket
data
- public Single<Void> rxWrite(Buffer data)
handler
called when the operation completesrxWrite
in interface WebSocketBase
rxWrite
in interface WriteStream<Buffer>
rxWrite
in class WebSocket
data
- public void end(Buffer data, Handler<AsyncResult<Void>> handler)
handler
called when the operation completesend
in interface WebSocketBase
end
in interface WriteStream<Buffer>
end
in class WebSocket
data
- handler
- public void end(Buffer data)
handler
called when the operation completesend
in interface WebSocketBase
end
in interface WriteStream<Buffer>
end
in class WebSocket
data
- public Single<Void> rxEnd(Buffer data)
handler
called when the operation completesrxEnd
in interface WebSocketBase
rxEnd
in interface WriteStream<Buffer>
rxEnd
in class WebSocket
data
- public boolean writeQueueFull()
true
if there are more bytes in the write queue than the value set using WebSocket.setWriteQueueMaxSize(int)
writeQueueFull
in interface WebSocketBase
writeQueueFull
in interface WriteStream<Buffer>
writeQueueFull
in class WebSocket
true
if write queue is fullpublic Pipe<Buffer> pipe()
WriteStream
.pipe
in interface WebSocketBase
pipe
in interface ReadStream<Buffer>
pipe
in class WebSocket
public void pipeTo(WriteStream<Buffer> dst, Handler<AsyncResult<Void>> handler)
ReadStream
to the WriteStream
.
Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Once this stream has ended or failed, the write stream will be ended and the handler
will be
called with the result.
pipeTo
in interface WebSocketBase
pipeTo
in interface ReadStream<Buffer>
pipeTo
in class WebSocket
dst
- the destination write streamhandler
- public void pipeTo(WriteStream<Buffer> dst)
ReadStream
to the WriteStream
.
Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Once this stream has ended or failed, the write stream will be ended and the handler
will be
called with the result.
pipeTo
in interface WebSocketBase
pipeTo
in interface ReadStream<Buffer>
pipeTo
in class WebSocket
dst
- the destination write streampublic Single<Void> rxPipeTo(WriteStream<Buffer> dst)
ReadStream
to the WriteStream
.
Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Once this stream has ended or failed, the write stream will be ended and the handler
will be
called with the result.
rxPipeTo
in interface WebSocketBase
rxPipeTo
in interface ReadStream<Buffer>
rxPipeTo
in class WebSocket
dst
- the destination write streampublic String binaryHandlerID()
WebSocket
is created, it may register an event handler with the event bus - the ID of that
handler is given by this method.
By default, no handler is registered, the feature must be enabled via WebSocketConnectOptions
or HttpServerOptions
.
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.
binaryHandlerID
in interface WebSocketBase
binaryHandlerID
in class WebSocket
public String textHandlerID()
WebSocket
is created, it may register an event handler with the eventbus, the ID of that
handler is given by textHandlerID
.
By default, no handler is registered, the feature must be enabled via WebSocketConnectOptions
or HttpServerOptions
.
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.
textHandlerID
in interface WebSocketBase
textHandlerID
in class WebSocket
public String subProtocol()
null
when the handler receives the WebSocket callback as the
handshake will not be completed yet.subProtocol
in interface WebSocketBase
subProtocol
in class WebSocket
public Short closeStatusCode()
null
when not yet received.closeStatusCode
in interface WebSocketBase
closeStatusCode
in class WebSocket
public String closeReason()
null
when not yet received.closeReason
in interface WebSocketBase
closeReason
in class WebSocket
public MultiMap headers()
null
on subsequent interactions.headers
in interface WebSocketBase
headers
in class WebSocket
public void end(Handler<AsyncResult<Void>> handler)
end
in interface WebSocketBase
end
in interface WriteStream<Buffer>
end
in class WebSocket
handler
- public void end()
end
in interface WebSocketBase
end
in interface WriteStream<Buffer>
end
in class WebSocket
public Single<Void> rxEnd()
rxEnd
in interface WebSocketBase
rxEnd
in interface WriteStream<Buffer>
rxEnd
in class WebSocket
public void close(Handler<AsyncResult<Void>> handler)
WebSocketBase.close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completesclose
in interface WebSocketBase
close
in class WebSocket
handler
- public void close()
WebSocketBase.close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completesclose
in interface WebSocketBase
close
in class WebSocket
public Single<Void> rxClose()
WebSocketBase.close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completesrxClose
in interface WebSocketBase
rxClose
in class WebSocket
public void close(short statusCode, Handler<AsyncResult<Void>> handler)
WebSocketBase.close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completesclose
in interface WebSocketBase
close
in class WebSocket
statusCode
- handler
- public void close(short statusCode)
WebSocketBase.close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completesclose
in interface WebSocketBase
close
in class WebSocket
statusCode
- public Single<Void> rxClose(short statusCode)
WebSocketBase.close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completesrxClose
in interface WebSocketBase
rxClose
in class WebSocket
statusCode
- public void close(short statusCode, String reason, Handler<AsyncResult<Void>> handler)
WebSocketBase.close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completesclose
in interface WebSocketBase
close
in class WebSocket
statusCode
- reason
- handler
- public void close(short statusCode, String reason)
WebSocketBase.close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completesclose
in interface WebSocketBase
close
in class WebSocket
statusCode
- reason
- public Single<Void> rxClose(short statusCode, String reason)
WebSocketBase.close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completesrxClose
in interface WebSocketBase
rxClose
in class WebSocket
statusCode
- reason
- public SocketAddress remoteAddress()
remoteAddress
in interface WebSocketBase
remoteAddress
in class WebSocket
null
(e.g a server bound on a domain socket). If useProxyProtocol
is set to true
, the address returned will be of the actual connecting client.public SocketAddress localAddress()
localAddress
in interface WebSocketBase
localAddress
in class WebSocket
null
(e.g a server bound on a domain socket) If useProxyProtocol
is set to true
, the address returned will be of the proxy.public boolean isSsl()
isSsl
in interface WebSocketBase
isSsl
in class WebSocket
HttpConnection
is encrypted via SSL/TLS.public boolean isClosed()
isClosed
in interface WebSocketBase
isClosed
in class WebSocket
true
if the WebSocket is closedpublic void connect(int port, String host, String requestURI, Handler<AsyncResult<WebSocket>> handler)
port
- the porthost
- the hostrequestURI
- the relative URIhandler
- handler that will be called with the WebSocket when connectedpublic void connect(int port, String host, String requestURI)
port
- the porthost
- the hostrequestURI
- the relative URIpublic Single<WebSocket> rxConnect(int port, String host, String requestURI)
port
- the porthost
- the hostrequestURI
- the relative URIpublic void connect(WebSocketConnectOptions options, Handler<AsyncResult<WebSocket>> handler)
options
- the request optionshandler
- handler that will be called with the WebSocket when connectedpublic void connect(WebSocketConnectOptions options)
options
- the request optionspublic Single<WebSocket> rxConnect(WebSocketConnectOptions options)
options
- the request optionspublic void connect(String host, String requestURI, Handler<AsyncResult<WebSocket>> handler)
host
- the hostrequestURI
- the relative URIhandler
- handler that will be called with the WebSocket when connectedpublic void connect(String host, String requestURI)
host
- the hostrequestURI
- the relative URIpublic Single<WebSocket> rxConnect(String host, String requestURI)
host
- the hostrequestURI
- the relative URIpublic void connect(String requestURI, Handler<AsyncResult<WebSocket>> handler)
requestURI
- the relative URIhandler
- handler that will be called with the WebSocket when connectedpublic void connect(String requestURI)
requestURI
- the relative URIpublic Single<WebSocket> rxConnect(String requestURI)
requestURI
- the relative URIpublic ClientWebSocket handler(Handler<Buffer> handler)
ReadStream
handler
in interface WebSocketBase
handler
in interface ReadStream<Buffer>
handler
in class WebSocket
public ClientWebSocket endHandler(Handler<Void> endHandler)
ReadStream
endHandler
in interface WebSocketBase
endHandler
in interface ReadStream<Buffer>
endHandler
in class WebSocket
public ClientWebSocket drainHandler(Handler<Void> handler)
WriteStream
Pipe
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 to maxSize / 2
.
drainHandler
in interface WebSocketBase
drainHandler
in interface WriteStream<Buffer>
drainHandler
in class WebSocket
handler
- the handlerpublic ClientWebSocket closeHandler(Handler<Void> handler)
WebSocketBase
WebSocketBase.closeStatusCode()
will return the status code and WebSocketBase.closeReason()
will return the reason.closeHandler
in interface WebSocketBase
closeHandler
in class WebSocket
handler
- the handlerpublic ClientWebSocket frameHandler(Handler<WebSocketFrame> handler)
WebSocketBase
frameHandler
in interface WebSocketBase
frameHandler
in class WebSocket
handler
- the handlerpublic ClientWebSocket textMessageHandler(Handler<String> handler)
WebSocket
WebSocketBase.binaryMessageHandler(io.vertx.core.Handler<io.vertx.rxjava.core.buffer.Buffer>)
, but the buffer will be converted to a String firsttextMessageHandler
in interface WebSocketBase
textMessageHandler
in class WebSocket
handler
- the handlerpublic ClientWebSocket binaryMessageHandler(Handler<Buffer> handler)
WebSocket
WebSocket.handler(io.vertx.core.Handler<io.vertx.rxjava.core.buffer.Buffer>)
except that if a message comes into the socket in multiple frames, the data from the frames will be aggregated
into a single buffer before calling the handler (using WebSocketFrame.isFinal()
to find the boundaries).binaryMessageHandler
in interface WebSocketBase
binaryMessageHandler
in class WebSocket
handler
- the handlerpublic ClientWebSocket pongHandler(Handler<Buffer> handler)
WebSocket
Pong frames may be at most 125 bytes (octets).
There is no ping handler since ping frames should immediately be responded to with a pong frame with identical content
Pong frames may be received unsolicited.
pongHandler
in interface WebSocketBase
pongHandler
in class WebSocket
handler
- the handlerpublic ClientWebSocket exceptionHandler(Handler<Throwable> handler)
ReadStream
exceptionHandler
in interface WebSocketBase
exceptionHandler
in interface ReadStream<Buffer>
exceptionHandler
in interface StreamBase
exceptionHandler
in interface WriteStream<Buffer>
exceptionHandler
in class WebSocket
handler
- the exception handlerpublic ClientWebSocket writeFrame(WebSocketFrame frame, Handler<AsyncResult<Void>> handler)
WebSocketBase
WebSocketBase.writeFrame(io.vertx.rxjava.core.http.WebSocketFrame, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completeswriteFrame
in interface WebSocketBase
writeFrame
in class WebSocket
public ClientWebSocket writeFrame(WebSocketFrame frame)
WebSocketBase
WebSocketBase.writeFrame(io.vertx.rxjava.core.http.WebSocketFrame, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completeswriteFrame
in interface WebSocketBase
writeFrame
in class WebSocket
public Single<Void> rxWriteFrame(WebSocketFrame frame)
WebSocketBase
WebSocketBase.writeFrame(io.vertx.rxjava.core.http.WebSocketFrame, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completesrxWriteFrame
in interface WebSocketBase
rxWriteFrame
in class WebSocket
public ClientWebSocket writeFinalTextFrame(String text, Handler<AsyncResult<Void>> handler)
WebSocketBase
WebSocketBase.writeFinalTextFrame(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completeswriteFinalTextFrame
in interface WebSocketBase
writeFinalTextFrame
in class WebSocket
public ClientWebSocket writeFinalTextFrame(String text)
WebSocketBase
WebSocketBase.writeFinalTextFrame(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completeswriteFinalTextFrame
in interface WebSocketBase
writeFinalTextFrame
in class WebSocket
public Single<Void> rxWriteFinalTextFrame(String text)
WebSocketBase
WebSocketBase.writeFinalTextFrame(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completesrxWriteFinalTextFrame
in interface WebSocketBase
rxWriteFinalTextFrame
in class WebSocket
public ClientWebSocket writeFinalBinaryFrame(Buffer data, Handler<AsyncResult<Void>> handler)
WebSocketBase
WebSocketBase.writeFinalBinaryFrame(io.vertx.rxjava.core.buffer.Buffer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completeswriteFinalBinaryFrame
in interface WebSocketBase
writeFinalBinaryFrame
in class WebSocket
public ClientWebSocket writeFinalBinaryFrame(Buffer data)
WebSocketBase
WebSocketBase.writeFinalBinaryFrame(io.vertx.rxjava.core.buffer.Buffer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completeswriteFinalBinaryFrame
in interface WebSocketBase
writeFinalBinaryFrame
in class WebSocket
public Single<Void> rxWriteFinalBinaryFrame(Buffer data)
WebSocketBase
WebSocketBase.writeFinalBinaryFrame(io.vertx.rxjava.core.buffer.Buffer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completesrxWriteFinalBinaryFrame
in interface WebSocketBase
rxWriteFinalBinaryFrame
in class WebSocket
public ClientWebSocket writeBinaryMessage(Buffer data, Handler<AsyncResult<Void>> handler)
WebSocketBase
WebSocketBase.writeBinaryMessage(io.vertx.rxjava.core.buffer.Buffer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completeswriteBinaryMessage
in interface WebSocketBase
writeBinaryMessage
in class WebSocket
public ClientWebSocket writeBinaryMessage(Buffer data)
WebSocketBase
WebSocketBase.writeBinaryMessage(io.vertx.rxjava.core.buffer.Buffer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completeswriteBinaryMessage
in interface WebSocketBase
writeBinaryMessage
in class WebSocket
public Single<Void> rxWriteBinaryMessage(Buffer data)
WebSocketBase
WebSocketBase.writeBinaryMessage(io.vertx.rxjava.core.buffer.Buffer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completesrxWriteBinaryMessage
in interface WebSocketBase
rxWriteBinaryMessage
in class WebSocket
public ClientWebSocket writeTextMessage(String text, Handler<AsyncResult<Void>> handler)
WebSocketBase
WebSocketBase.writeTextMessage(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completeswriteTextMessage
in interface WebSocketBase
writeTextMessage
in class WebSocket
public ClientWebSocket writeTextMessage(String text)
WebSocketBase
WebSocketBase.writeTextMessage(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completeswriteTextMessage
in interface WebSocketBase
writeTextMessage
in class WebSocket
public Single<Void> rxWriteTextMessage(String text)
WebSocketBase
WebSocketBase.writeTextMessage(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completesrxWriteTextMessage
in interface WebSocketBase
rxWriteTextMessage
in class WebSocket
public ClientWebSocket writePing(Buffer data, Handler<AsyncResult<Void>> handler)
WebSocketBase
This method should not be used to write application data and should only be used for implementing a keep alive or to ensure the client is still responsive, see RFC 6455 Section section 5.5.2.
There is no handler for ping frames because RFC 6455 clearly states that the only response to a ping frame is a pong frame with identical contents.
writePing
in interface WebSocketBase
writePing
in class WebSocket
data
- the data to write, may be at most 125 byteshandler
- called when the ping frame has been successfully writtenpublic ClientWebSocket writePing(Buffer data)
WebSocketBase
This method should not be used to write application data and should only be used for implementing a keep alive or to ensure the client is still responsive, see RFC 6455 Section section 5.5.2.
There is no handler for ping frames because RFC 6455 clearly states that the only response to a ping frame is a pong frame with identical contents.
writePing
in interface WebSocketBase
writePing
in class WebSocket
data
- the data to write, may be at most 125 bytespublic Single<Void> rxWritePing(Buffer data)
WebSocketBase
This method should not be used to write application data and should only be used for implementing a keep alive or to ensure the client is still responsive, see RFC 6455 Section section 5.5.2.
There is no handler for ping frames because RFC 6455 clearly states that the only response to a ping frame is a pong frame with identical contents.
rxWritePing
in interface WebSocketBase
rxWritePing
in class WebSocket
data
- the data to write, may be at most 125 bytespublic ClientWebSocket writePong(Buffer data, Handler<AsyncResult<Void>> handler)
WebSocketBase
This method should not be used to write application data and should only be used for implementing a keep alive or to ensure the client is still responsive, see RFC 6455 section 5.5.2.
There is no need to manually write a pong frame, as the server and client both handle responding to a ping from with a pong from automatically and this is exposed to users. RFC 6455 section 5.5.3 states that pongs may be sent unsolicited in order to implement a one way heartbeat.
writePong
in interface WebSocketBase
writePong
in class WebSocket
data
- the data to write, may be at most 125 byteshandler
- called when the pong frame has been successfully writtenpublic ClientWebSocket writePong(Buffer data)
WebSocketBase
This method should not be used to write application data and should only be used for implementing a keep alive or to ensure the client is still responsive, see RFC 6455 section 5.5.2.
There is no need to manually write a pong frame, as the server and client both handle responding to a ping from with a pong from automatically and this is exposed to users. RFC 6455 section 5.5.3 states that pongs may be sent unsolicited in order to implement a one way heartbeat.
writePong
in interface WebSocketBase
writePong
in class WebSocket
data
- the data to write, may be at most 125 bytespublic Single<Void> rxWritePong(Buffer data)
WebSocketBase
This method should not be used to write application data and should only be used for implementing a keep alive or to ensure the client is still responsive, see RFC 6455 section 5.5.2.
There is no need to manually write a pong frame, as the server and client both handle responding to a ping from with a pong from automatically and this is exposed to users. RFC 6455 section 5.5.3 states that pongs may be sent unsolicited in order to implement a one way heartbeat.
rxWritePong
in interface WebSocketBase
rxWritePong
in class WebSocket
data
- the data to write, may be at most 125 bytespublic SSLSession sslSession()
sslSession
in class WebSocket
public static ClientWebSocket newInstance(ClientWebSocket arg)
Copyright © 2024 Eclipse. All rights reserved.