
public.javadoc.org.spincast.plugins.undertow.SpincastUndertowWebsocketEndpointWriter.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spincast-website Show documentation
Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
SpincastUndertowWebsocketEndpointWriter (org.spincast:spincast-framework 2.1.1 API)
Package org.spincast.plugins.undertow
Class SpincastUndertowWebsocketEndpointWriter
java.lang.Object
org.spincast.plugins.undertow.SpincastUndertowWebsocketEndpointWriter
- All Implemented Interfaces:
UndertowWebsocketEndpointWriter
public class SpincastUndertowWebsocketEndpointWriter
extends Object
implements UndertowWebsocketEndpointWriter
-
Nested Class Summary
Nested Classes
Modifier and Type
Class
Description
protected static interface
Interface to create a write executor.
-
Field Summary
Fields
-
Constructor Summary
Constructors
Constructor
Description
SpincastUndertowWebsocketEndpointWriter(Map<String,io.undertow.websockets.core.WebSocketChannel> channels,
SpincastUndertowConfig spincastUndertowConfig)
Constructor
-
Method Summary
Modifier and Type
Method
Description
protected byte[]
protected SpincastUndertowConfig
void
sendClosingConnection(int closingCode,
String closingReason,
Set<String> peerIds,
ClosedEventSentCallback callback)
Sends a "closing connection" message to specified peers.
void
sendMessage(Set<String> peerIds,
byte[] bytes,
WebsocketPeersWriteCallback callback)
Sends a byte array message to specific
peers.
void
sendMessage(Set<String> peerIds,
String message,
WebsocketPeersWriteCallback callback)
Sends a String message to specific
peers.
void
sendPings(WebsocketPeersWriteCallback callback)
Sends a ping
message to all peers.
void
write(Set<String> peerIds,
SpincastUndertowWebsocketEndpointWriter.IWriteExecutor executor)
Calls the executor's write(...) method for each peers and, when all
asynchrounous calls are done, calls its writeErrors(...) with
the ids of the peers for which the write failed with an IOException.
-
Field Details
-
logger
protected static final org.slf4j.Logger logger
-
Constructor Details
-
SpincastUndertowWebsocketEndpointWriter
public SpincastUndertowWebsocketEndpointWriter(Map<String,io.undertow.websockets.core.WebSocketChannel> channels,
SpincastUndertowConfig spincastUndertowConfig)
Constructor
-
Method Details
-
getChannelsMap
-
getSpincastUndertowConfig
-
getPingBytes
protected byte[] getPingBytes()
-
sendPings
Description copied from interface: UndertowWebsocketEndpointWriter
Sends a ping
message to all peers.
- Specified by:
sendPings
in interface UndertowWebsocketEndpointWriter
-
sendMessage
Description copied from interface: UndertowWebsocketEndpointWriter
Sends a String message to specific
peers.
- Specified by:
sendMessage
in interface UndertowWebsocketEndpointWriter
-
sendMessage
Description copied from interface: UndertowWebsocketEndpointWriter
Sends a byte array message to specific
peers.
- Specified by:
sendMessage
in interface UndertowWebsocketEndpointWriter
-
sendClosingConnection
public void sendClosingConnection(int closingCode,
String closingReason,
Set<String> peerIds,
ClosedEventSentCallback callback)
Description copied from interface: UndertowWebsocketEndpointWriter
Sends a "closing connection" message to specified peers.
No exception thrown if the message can't be sent.
- Specified by:
sendClosingConnection
in interface UndertowWebsocketEndpointWriter
-
write
public void write(Set<String> peerIds,
SpincastUndertowWebsocketEndpointWriter.IWriteExecutor executor)
Calls the executor's write(...) method for each peers and, when all
asynchrounous calls are done, calls its writeErrors(...) with
the ids of the peers for which the write failed with an IOException.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy