public abstract class WebSocketServer extends java.lang.Object implements WebSocketListener
Constructor and Description |
---|
WebSocketServer(int port)
Creates a
WebSocketServer instance working on the specific TCP
port. |
Modifier and Type | Method and Description |
---|---|
abstract WebSocket[] |
getConnections()
Returns an array of
WebSocket currently connected clients. |
abstract void |
notifyAll(java.lang.String message)
Sends a message to all connected clients.
|
abstract void |
start()
Starts the server, binds to the chosen TCP port number and listens for
WebSocket connection requests. |
abstract void |
stop()
Stops the servers, closes all connected clients, frees used TCP port.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onWebsocketClose, onWebsocketMessage, onWebsocketOpen
public WebSocketServer(int port)
WebSocketServer
instance working on the specific TCP
port.port
- TCP port to be used.public abstract WebSocket[] getConnections()
WebSocket
currently connected clients.WebSocket
.public abstract void start()
WebSocket
connection requests.public abstract void stop()
public abstract void notifyAll(java.lang.String message)
message
- A message to be sent.