public class WebSocketConnection extends AbstractConnection
An XMPP WebSocket connection.
| Constructor and Description |
|---|
WebSocketConnection(javax.websocket.Session session,
StreamHandler streamHandler,
java.util.function.Consumer<java.lang.Throwable> onException,
java.util.concurrent.CompletableFuture<java.lang.Void> closeFuture,
ConnectionConfiguration connectionConfiguration) |
| Modifier and Type | Method and Description |
|---|---|
java.util.concurrent.CompletionStage<java.lang.Void> |
closeFuture()
Returns a future which is complete, when the connection is closed.
|
void |
flush()
Flushes the connection.
|
java.net.InetSocketAddress |
getRemoteAddress()
Gets the remote address of this connection.
|
boolean |
isSecure()
Indicates whether this connection is secured by TLS/SSL.
|
java.util.concurrent.CompletionStage<java.lang.Void> |
open(SessionOpen sessionOpen)
Opens the XML stream to the peer entity.
|
java.util.concurrent.CompletableFuture<java.lang.Void> |
send(StreamElement streamElement)
Sends an element to the peer entity.
|
java.lang.String |
toString() |
java.util.concurrent.CompletableFuture<java.lang.Void> |
write(StreamElement streamElement)
Writes the element to the stream without really sending it.
|
close, closeAsync, closeAsync, getConfiguration, getStreamId, isUsingAcknowledgementspublic WebSocketConnection(javax.websocket.Session session,
StreamHandler streamHandler,
java.util.function.Consumer<java.lang.Throwable> onException,
java.util.concurrent.CompletableFuture<java.lang.Void> closeFuture,
ConnectionConfiguration connectionConfiguration)
public final java.util.concurrent.CompletionStage<java.lang.Void> closeFuture()
ConnectionReturns a future which is complete, when the connection is closed.
public java.util.concurrent.CompletableFuture<java.lang.Void> send(StreamElement streamElement)
ConnectionstreamElement - The element.public final java.util.concurrent.CompletableFuture<java.lang.Void> write(StreamElement streamElement)
ConnectionWrites the element to the stream without really sending it. It must be flushed.
streamElement - The element.public final void flush()
ConnectionFlushes the connection. Any buffered elements written via Connection.write(StreamElement) are sent.
public final java.net.InetSocketAddress getRemoteAddress()
ConnectionGets the remote address of this connection.
public final java.util.concurrent.CompletionStage<java.lang.Void> open(SessionOpen sessionOpen)
ConnectionOpens the XML stream to the peer entity.
sessionOpen - The session open information.public final boolean isSecure()
ConnectionIndicates whether this connection is secured by TLS/SSL.
public final java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2014–2019 XMPP.rocks. All rights reserved.