public class SpincastUndertowWebsocketEndpointWriter extends Object implements UndertowWebsocketEndpointWriter
| Modifier and Type | Class and Description |
|---|---|
protected static interface |
SpincastUndertowWebsocketEndpointWriter.IWriteExecutor
Interface to create a write executor.
|
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
SpincastUndertowWebsocketEndpointWriter(Map<String,io.undertow.websockets.core.WebSocketChannel> channels,
SpincastUndertowConfig spincastUndertowConfig)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected Map<String,io.undertow.websockets.core.WebSocketChannel> |
getChannelsMap() |
protected byte[] |
getPingBytes() |
protected SpincastUndertowConfig |
getSpincastUndertowConfig() |
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.
|
public SpincastUndertowWebsocketEndpointWriter(Map<String,io.undertow.websockets.core.WebSocketChannel> channels, SpincastUndertowConfig spincastUndertowConfig)
protected SpincastUndertowConfig getSpincastUndertowConfig()
protected byte[] getPingBytes()
public void sendPings(WebsocketPeersWriteCallback callback)
UndertowWebsocketEndpointWriterping message to all peers.sendPings in interface UndertowWebsocketEndpointWriterpublic void sendMessage(Set<String> peerIds, String message, WebsocketPeersWriteCallback callback)
UndertowWebsocketEndpointWritersendMessage in interface UndertowWebsocketEndpointWriterpublic void sendMessage(Set<String> peerIds, byte[] bytes, WebsocketPeersWriteCallback callback)
UndertowWebsocketEndpointWritersendMessage in interface UndertowWebsocketEndpointWriterpublic void sendClosingConnection(int closingCode,
String closingReason,
Set<String> peerIds,
ClosedEventSentCallback callback)
UndertowWebsocketEndpointWritersendClosingConnection in interface UndertowWebsocketEndpointWriterpublic void write(Set<String> peerIds, SpincastUndertowWebsocketEndpointWriter.IWriteExecutor executor)
Copyright © 2019. All rights reserved.