public class SpincastUndertowWebsocketEndpointWriter extends Object implements IUndertowWebsocketEndpointWriter
| Modifier and Type | Class and Description |
|---|---|
protected static interface |
SpincastUndertowWebsocketEndpointWriter.IWriteExecutor
Interface to create a write executor.
|
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
SpincastUndertowWebsocketEndpointWriter(Map<String,io.undertow.websockets.core.WebSocketChannel> channels,
ISpincastUndertowConfig spincastUndertowConfig)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected Map<String,io.undertow.websockets.core.WebSocketChannel> |
getChannelsMap() |
protected byte[] |
getPingBytes() |
protected ISpincastUndertowConfig |
getSpincastUndertowConfig() |
void |
sendClosingConnection(int closingCode,
String closingReason,
Set<String> peerIds,
IClosedEventSentCallback callback)
Sends a "closing connection" message to specified peers.
|
void |
sendMessage(Set<String> peerIds,
byte[] bytes,
IWebsocketPeersWriteCallback callback)
Sends a byte array message to specific
peers.
|
void |
sendMessage(Set<String> peerIds,
String message,
IWebsocketPeersWriteCallback callback)
Sends a String message to specific
peers.
|
void |
sendPings(IWebsocketPeersWriteCallback 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, ISpincastUndertowConfig spincastUndertowConfig)
protected ISpincastUndertowConfig getSpincastUndertowConfig()
protected byte[] getPingBytes()
public void sendPings(IWebsocketPeersWriteCallback callback)
IUndertowWebsocketEndpointWriterping message to all peers.sendPings in interface IUndertowWebsocketEndpointWriterpublic void sendMessage(Set<String> peerIds, String message, IWebsocketPeersWriteCallback callback)
IUndertowWebsocketEndpointWritersendMessage in interface IUndertowWebsocketEndpointWriterpublic void sendMessage(Set<String> peerIds, byte[] bytes, IWebsocketPeersWriteCallback callback)
IUndertowWebsocketEndpointWritersendMessage in interface IUndertowWebsocketEndpointWriterpublic void sendClosingConnection(int closingCode,
String closingReason,
Set<String> peerIds,
IClosedEventSentCallback callback)
IUndertowWebsocketEndpointWritersendClosingConnection in interface IUndertowWebsocketEndpointWriterpublic void write(Set<String> peerIds, SpincastUndertowWebsocketEndpointWriter.IWriteExecutor executor)
Copyright © 2016. All rights reserved.