Class WebSocketConnectionBase
java.lang.Object
io.quarkus.websockets.next.runtime.WebSocketConnectionBase
- All Implemented Interfaces:
Connection,Sender
- Direct Known Subclasses:
WebSocketClientConnectionImpl,WebSocketConnectionImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Codecsprotected final Instantprotected final HandshakeRequestprotected final Stringprotected final TrafficLogger -
Constructor Summary
ConstructorsConstructorDescriptionWebSocketConnectionBase(Map<String, String> pathParams, Codecs codecs, HandshakeRequest handshakeRequest, TrafficLogger trafficLogger, SendingInterceptor sendingInterceptor) -
Method Summary
Modifier and TypeMethodDescriptionio.smallrye.mutiny.Uni<Void> close()Close the connection.io.smallrye.mutiny.Uni<Void> close(CloseReason reason) Close the connection with a specific reason.id()booleanisClosed()booleanisSecure()(package private) voidio.smallrye.mutiny.Uni<Void> sendBinary(io.vertx.core.buffer.Buffer message) Send a binary message.io.smallrye.mutiny.Uni<Void> sendPing(io.vertx.core.buffer.Buffer data) Send a ping message.io.smallrye.mutiny.Uni<Void> sendPong(io.vertx.core.buffer.Buffer data) Send an unsolicited pong message.io.smallrye.mutiny.Uni<Void> Send a text message.<M> io.smallrye.mutiny.Uni<Void> sendText(M message) Send a text message.userData()(package private) abstract io.vertx.core.http.WebSocketBaseMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.quarkus.websockets.next.Connection
closeAndAwait, closeAndAwait, isOpenMethods inherited from interface io.quarkus.websockets.next.Sender
sendBinary, sendBinaryAndAwait, sendBinaryAndAwait, sendPingAndAwait, sendPongAndAwait, sendTextAndAwait, sendTextAndAwait
-
Field Details
-
identifier
-
pathParams
-
codecs
-
handshakeRequest
-
creationTime
-
trafficLogger
-
-
Constructor Details
-
WebSocketConnectionBase
WebSocketConnectionBase(Map<String, String> pathParams, Codecs codecs, HandshakeRequest handshakeRequest, TrafficLogger trafficLogger, SendingInterceptor sendingInterceptor)
-
-
Method Details
-
webSocket
abstract io.vertx.core.http.WebSocketBase webSocket() -
id
- Specified by:
idin interfaceConnection- Returns:
- the unique identifier assigned to this connection
-
pathParam
- Specified by:
pathParamin interfaceConnection- Parameters:
name-- Returns:
- the value of the path parameter or
null - See Also:
-
sendText
Description copied from interface:SenderSend a text message. -
sendBinary
Description copied from interface:SenderSend a binary message.- Specified by:
sendBinaryin interfaceSender- Parameters:
message-- Returns:
- a new
Uniwith anullitem
-
sendText
Description copied from interface:SenderSend a text message.A
TextMessageCodecis used to encode the message. -
sendPing
Description copied from interface:SenderSend a ping message. -
sendAutoPing
void sendAutoPing() -
sendPong
Description copied from interface:SenderSend an unsolicited pong message.Note that the server automatically responds to a ping message sent from the client. However, the RFC 6455 section 5.5.3 states that unsolicited pong may serve as a unidirectional heartbeat.
-
close
Description copied from interface:ConnectionClose the connection.- Specified by:
closein interfaceConnection- Returns:
- a new
Uniwith anullitem
-
close
Description copied from interface:ConnectionClose the connection with a specific reason.- Specified by:
closein interfaceConnection- Parameters:
reason-- Returns:
- a new
Uniwith anullitem
-
isSecure
public boolean isSecure()- Specified by:
isSecurein interfaceConnection- Returns:
trueif the HTTP connection is encrypted via SSL/TLS
-
isClosed
public boolean isClosed()- Specified by:
isClosedin interfaceConnection- Returns:
trueif the WebSocket is closed
-
handshakeRequest
- Specified by:
handshakeRequestin interfaceConnection- Returns:
- the handshake request
-
creationTime
- Specified by:
creationTimein interfaceConnection- Returns:
- the time when this connection was created
-
broadcast
-
closeReason
- Specified by:
closeReasonin interfaceConnection- Returns:
- the close reason or
nullif the connection is not closed
-
userData
- Specified by:
userDatain interfaceConnection- Returns:
- the user data associated with this connection
-