Top Description Fields Constructors Methods
io.vertx.core.http.impl

public Class ClientWebSocketImpl

extends Object
implements ClientWebSocketInternal
Class Inheritance
All Implemented Interfaces
io.vertx.core.http.impl.ClientWebSocketInternal, io.vertx.core.http.ClientWebSocket, io.vertx.core.http.WebSocket, io.vertx.core.http.WebSocketBase, io.vertx.core.streams.WriteStream, io.vertx.core.streams.StreamBase, io.vertx.core.streams.ReadStream
Imports
io.vertx.codegen.annotations.Nullable, io.vertx.core.*, io.vertx.core.buffer.Buffer, io.vertx.core.http.*, io.vertx.core.impl.ContextInternal, .VertxInternal, io.vertx.core.net.SocketAddress, javax.net.ssl.SSLPeerUnverifiedException, .SSLSession, javax.security.cert.X509Certificate, java.security.cert.Certificate, java.util.List, java.util.concurrent.atomic.AtomicReference

Client WebSocket implementation

Field Summary

Modifier and TypeField and Description
private Handler<Buffer>
private HttpClientBase
private Handler<Void>
private final AtomicReference<Promise<WebSocket>>
private Handler<Buffer>
private Handler<Void>
private Handler<Void>
private Handler<Throwable>
private Handler<WebSocketFrame>
private Handler<Buffer>
private Handler<String>
private volatile WebSocket

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public String
binaryHandlerID()

Implements io.vertx.core.http.WebSocketBase.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.

public ClientWebSocket
public Future<Void>
close()

Implements io.vertx.core.http.WebSocketBase.close.

Close the WebSocket sending the default close frame.

public void
close(Handler<AsyncResult<Void>> handler)

Implements io.vertx.core.http.WebSocketBase.close.

Same as close() but with an handler called when the operation completes

public Future<Void>
close(short
the status code
statusCode
)

Implements io.vertx.core.http.WebSocketBase.close.

Close the WebSocket sending a close frame with specified status code.

public void
close(short statusCode, Handler<AsyncResult<Void>> handler)

Implements io.vertx.core.http.WebSocketBase.close.

Same as close(short) but with an handler called when the operation completes

public Future<Void>
close(short statusCode, @Nullable String reason)

public void
close(short statusCode, @Nullable String reason, Handler<AsyncResult<Void>> handler)

public ClientWebSocket
public String
closeReason()

Implements io.vertx.core.http.WebSocketBase.closeReason.

Returns the close reason message from the remote endpoint or null when not yet received.

public Short
closeStatusCode()

Implements io.vertx.core.http.WebSocketBase.closeStatusCode.

Returns the close status code received from the remote endpoint or null when not yet received.

public Future<WebSocket>
connect(WebSocketConnectOptions options)

Implements io.vertx.core.http.ClientWebSocket.connect.

Like connect(WebSocketConnectOptions, Handler) but returns a Future of the asynchronous result

public Future<WebSocket>
private Future<WebSocket>
public void
connect(WebSocketConnectOptions
the request options
options
,
Handler<AsyncResult<WebSocket>>
handler that will be called with the WebSocket when connected
handler
)

Implements io.vertx.core.http.ClientWebSocket.connect.

Connect a WebSocket with the specified options.

private WebSocket
public ClientWebSocket
public Future<Void>
end()

Implements io.vertx.core.http.WebSocketBase.end.

Ends the stream.

public void
end(Handler<AsyncResult<Void>> handler)

Implements io.vertx.core.http.WebSocketBase.end.

Same as end() but with an handler called when the operation completes Calls close(Handler)

public ClientWebSocket
public ClientWebSocket
public WebSocket
fetch(long amount)

Implements io.vertx.core.http.WebSocket.fetch.

Fetch the specified amount of elements.

public ClientWebSocket
public ClientWebSocket
public MultiMap
headers()

Implements io.vertx.core.http.WebSocketBase.headers.

Returns the HTTP headers when the WebSocket is first obtained in the handler.

public boolean
public boolean
public SocketAddress
public WebSocket
pause()

Implements io.vertx.core.http.WebSocket.pause.

Pause the ReadStream, it sets the buffer in fetch mode and clears the actual demand.

public X509Certificate[]
peerCertificateChain()

Implements io.vertx.core.http.WebSocketBase.peerCertificateChain.

References Deprecated X509Certificate is deprecated or references (maybe indirectly) at least one deprecated element.

public List<Certificate>
public ClientWebSocket
public SocketAddress
public WebSocket
resume()

Implements io.vertx.core.http.WebSocket.resume.

Resume reading, and sets the buffer in flowing mode.

public WebSocket
setWriteQueueMaxSize(int
the max size of the write stream
maxSize
)

Implements io.vertx.core.http.WebSocket.setWriteQueueMaxSize.

Set the maximum size of the write queue to maxSize.

public SSLSession
public String
subProtocol()

Implements io.vertx.core.http.WebSocketBase.subProtocol.

Returns the WebSocket sub protocol selected by the WebSocket handshake.

public String
textHandlerID()

Implements io.vertx.core.http.WebSocketBase.textHandlerID.

When a WebSocket is created, it may register an event handler with the eventbus, the ID of that handler is given by textHandlerID.

public ClientWebSocket
public Future<Void>
write(Buffer
the data to write
data
)

Implements io.vertx.core.streams.WriteStream.write.

References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Write some data to the stream.

public void
write(Buffer data, Handler<AsyncResult<Void>> handler)

Implements io.vertx.core.streams.WriteStream.write.

References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Same as write(T) but with an handler called when the operation completes

public Future<Void>
writeBinaryMessage(Buffer
the data to write
data
)

Implements io.vertx.core.http.WebSocketBase.writeBinaryMessage.

References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Writes a (potentially large) piece of binary data to the connection.

public ClientWebSocket
writeBinaryMessage(Buffer data, Handler<AsyncResult<Void>> handler)

Implements io.vertx.core.http.ClientWebSocket.writeBinaryMessage.

References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Same as writeBinaryMessage(Buffer) but with an handler called when the operation completes

public Future<Void>
writeFinalBinaryFrame(Buffer
The data to write
data
)

Implements io.vertx.core.http.WebSocketBase.writeFinalBinaryFrame.

References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Write a final WebSocket binary frame to the connection

public ClientWebSocket
writeFinalBinaryFrame(Buffer data, Handler<AsyncResult<Void>> handler)

Implements io.vertx.core.http.ClientWebSocket.writeFinalBinaryFrame.

References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Same as writeFinalBinaryFrame(Buffer, Handler) but with an handler called when the operation completes

public Future<Void>
writeFinalTextFrame(String
The text to write
text
)

Implements io.vertx.core.http.WebSocketBase.writeFinalTextFrame.

Write a final WebSocket text frame to the connection

public ClientWebSocket
writeFinalTextFrame(String text, Handler<AsyncResult<Void>> handler)

Implements io.vertx.core.http.ClientWebSocket.writeFinalTextFrame.

Same as writeFinalTextFrame(String, Handler) but with an handler called when the operation completes

public Future<Void>
writeFrame(WebSocketFrame
the frame to write
frame
)

Implements io.vertx.core.http.WebSocketBase.writeFrame.

Write a WebSocket frame to the connection

public ClientWebSocket
writeFrame(WebSocketFrame frame, Handler<AsyncResult<Void>> handler)

Implements io.vertx.core.http.ClientWebSocket.writeFrame.

Same as writeFrame(WebSocketFrame) but with an handler called when the operation completes

public Future<Void>
writePing(Buffer data)

Implements io.vertx.core.http.WebSocketBase.writePing.

References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Like writePing(Buffer, Handler) but with an handler called when the message has been written or failed to be written.

public ClientWebSocket
writePing(Buffer
the data to write, may be at most 125 bytes
data
,
Handler<AsyncResult<Void>>
called when the ping frame has been successfully written
handler
)

Implements io.vertx.core.http.ClientWebSocket.writePing.

References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Writes a ping frame to the connection.

public Future<Void>
writePong(Buffer data)

Implements io.vertx.core.http.WebSocketBase.writePong.

References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Like writePong(Buffer, Handler) but with an handler called when the message has been written or failed to be written.

public ClientWebSocket
writePong(Buffer
the data to write, may be at most 125 bytes
data
,
Handler<AsyncResult<Void>>
called when the pong frame has been successfully written
handler
)

Implements io.vertx.core.http.ClientWebSocket.writePong.

References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Writes a pong frame to the connection.

public boolean
writeQueueFull()

Implements io.vertx.core.streams.WriteStream.writeQueueFull.

This will return true if there are more bytes in the write queue than the value set using setWriteQueueMaxSize

public Future<Void>
writeTextMessage(String
the data to write
text
)

Implements io.vertx.core.http.WebSocketBase.writeTextMessage.

Writes a (potentially large) piece of text data to the connection.

public ClientWebSocket
writeTextMessage(String text, Handler<AsyncResult<Void>> handler)

Implements io.vertx.core.http.ClientWebSocket.writeTextMessage.

Same as writeTextMessage(String) but with an handler called when the operation completes

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait