public static class PojoClientServer.Server extends Object
| Constructor and Description |
|---|
Server(String name,
int listenPort,
Consumer<PojoClientServer.SingleConnection> callback)
Constructor for a server object.
|
Server(String name,
int listenPort,
org.sfj.PojoClientServer.Encoder encoder,
org.sfj.PojoClientServer.Decoder decoder,
Consumer<PojoClientServer.SingleConnection> callback)
Constructor for a server object.
|
| Modifier and Type | Method and Description |
|---|---|
Collection<PojoClientServer.SingleConnection> |
getConnections()
Return current connections, in no particular order.
|
Throwable |
getLastIgnoredThrowable()
Get the last ignored exception
|
String |
getName()
Get the name.
|
boolean |
isListening()
Check if we are currently listening.
|
PojoClientServer.Server |
startServer()
Start the server.
|
void |
stop()
Stop the server, close all connections.
|
public Server(String name, int listenPort, Consumer<PojoClientServer.SingleConnection> callback)
name - Name of this server.listenPort - Port to listen oncallback - Callback for accepting new connections.public Server(String name, int listenPort, org.sfj.PojoClientServer.Encoder encoder, org.sfj.PojoClientServer.Decoder decoder, Consumer<PojoClientServer.SingleConnection> callback)
name - Name of this server.listenPort - Port to listen on.encoder - Encoderdecoder - Decodercallback - Callback for accepting new connections.public String getName()
public Throwable getLastIgnoredThrowable()
public PojoClientServer.Server startServer() throws IOException
IOException - on failure to sonnectpublic boolean isListening()
public Collection<PojoClientServer.SingleConnection> getConnections()
public void stop()
Copyright © 2020. All rights reserved.