Interface WebSocketWriter
- All Superinterfaces:
org.reactivestreams.Publisher<WebSocketFrame>
,StreamMessage<WebSocketFrame>
,StreamWriter<WebSocketFrame>
,WebSocket
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Sends the closing handshake withWebSocketCloseStatus.NORMAL_CLOSURE
.void
close
(WebSocketCloseStatus status) Sends the closing handshake with theWebSocketCloseStatus
.void
close
(WebSocketCloseStatus status, String reasonPhrase) Sends the closing handshake with theWebSocketCloseStatus
and the reason.void
Sends the closing handshake with theWebSocketCloseStatus.INTERNAL_SERVER_ERROR
andThrowable.getMessage()
.default boolean
tryWrite
(byte[] data) Writes a binaryWebSocketFrame
to thisWebSocket
.default boolean
tryWrite
(byte[] data, boolean finalFragment) Writes a binaryWebSocketFrame
to thisWebSocket
.default boolean
Writes a textWebSocketFrame
to thisWebSocket
.default boolean
Writes a textWebSocketFrame
to thisWebSocket
.default void
write
(byte[] data) Writes a binaryWebSocketFrame
to thisWebSocket
.default void
write
(byte[] data, boolean finalFragment) Writes a binaryWebSocketFrame
to thisWebSocket
whoseWebSocketFrame.isFinalFragment()
is set tofinalFragment
.default void
Writes a textWebSocketFrame
to thisWebSocket
.default void
Writes a textWebSocketFrame
to thisWebSocket
whoseWebSocketFrame.isFinalFragment()
is set tofinalFragment
.default void
Writes a pingWebSocketFrame
to thisWebSocket
.default void
writePing
(byte[] data) Writes a pingWebSocketFrame
to thisWebSocket
with the data.default void
Writes a pongWebSocketFrame
to thisWebSocket
.default void
writePong
(byte[] data) Writes a pongWebSocketFrame
to thisWebSocket
with the data.Methods inherited from interface com.linecorp.armeria.common.stream.StreamMessage
abort, abort, collect, collect, collect, decode, decode, defaultSubscriberExecutor, demand, endWith, filter, isComplete, isEmpty, map, mapAsync, mapError, mapParallel, mapParallel, peek, peek, peekError, recoverAndResume, recoverAndResume, subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribeOn, toDuplicator, toDuplicator, toInputStream, toInputStream, whenComplete, writeTo
Methods inherited from interface com.linecorp.armeria.common.stream.StreamWriter
isOpen, tryWrite, tryWrite, whenConsumed, write, write
-
Method Details
-
write
Writes a textWebSocketFrame
to thisWebSocket
.- See Also:
-
write
Writes a textWebSocketFrame
to thisWebSocket
whoseWebSocketFrame.isFinalFragment()
is set tofinalFragment
.- See Also:
-
write
default void write(byte[] data) Writes a binaryWebSocketFrame
to thisWebSocket
.- See Also:
-
write
default void write(byte[] data, boolean finalFragment) Writes a binaryWebSocketFrame
to thisWebSocket
whoseWebSocketFrame.isFinalFragment()
is set tofinalFragment
.- See Also:
-
tryWrite
Writes a textWebSocketFrame
to thisWebSocket
.- Returns:
true
if the text has been scheduled for publication.false
if the writer has been closed already.- See Also:
-
tryWrite
Writes a textWebSocketFrame
to thisWebSocket
.- Returns:
true
if the text has been scheduled for publication.false
if the writer has been closed already.- See Also:
-
tryWrite
default boolean tryWrite(byte[] data) Writes a binaryWebSocketFrame
to thisWebSocket
.- Returns:
true
if the data has been scheduled for publication.false
if the writer has been closed already.- See Also:
-
tryWrite
default boolean tryWrite(byte[] data, boolean finalFragment) Writes a binaryWebSocketFrame
to thisWebSocket
.- Returns:
true
if the data has been scheduled for publication.false
if the writer has been closed already.- See Also:
-
writePing
default void writePing()Writes a pingWebSocketFrame
to thisWebSocket
.- See Also:
-
writePing
default void writePing(byte[] data) Writes a pingWebSocketFrame
to thisWebSocket
with the data.- See Also:
-
writePong
default void writePong()Writes a pongWebSocketFrame
to thisWebSocket
.- See Also:
-
writePong
default void writePong(byte[] data) Writes a pongWebSocketFrame
to thisWebSocket
with the data.- See Also:
-
close
void close()Sends the closing handshake withWebSocketCloseStatus.NORMAL_CLOSURE
.- Specified by:
close
in interfaceStreamWriter<WebSocketFrame>
-
close
Sends the closing handshake with theWebSocketCloseStatus
. -
close
Sends the closing handshake with theWebSocketCloseStatus
and the reason. -
close
Sends the closing handshake with theWebSocketCloseStatus.INTERNAL_SERVER_ERROR
andThrowable.getMessage()
.- Specified by:
close
in interfaceStreamWriter<WebSocketFrame>
-