public class DefaultServer extends Object implements Server
Server.
The following options are configurable.
| Constructor and Description |
|---|
DefaultServer() |
| Modifier and Type | Method and Description |
|---|---|
Sentence |
all()
Returns a sentence that every socket in this server has to follow.
|
Server |
all(Action<ServerSocket> action)
Executes the given action retrieving every socket in this server.
|
Sentence |
byTag(String... names)
Returns a sentence that the socket tagged with the given tags in this server have to follow.
|
Server |
byTag(String[] names,
Action<ServerSocket> action)
Executes the given action retrieving the socket tagged with the given tags in this server.
|
Server |
byTag(String name,
Action<ServerSocket> action)
Executes the given action retrieving the socket tagged with the given tag in this server.
|
void |
on(ServerTransport transport) |
Server |
onsocket(Action<ServerSocket> action)
Adds a socket event handler to be called when the socket has been created in this server.
|
void |
set_heartbeat(int _heartbeat)
To speed up the protocol tests.
|
void |
setHeartbeat(int heartbeat)
A heartbeat interval in milliseconds to maintain a connection alive and prevent server from
holding idle connections.
|
public void on(ServerTransport transport)
on in interface Action<ServerTransport>public Sentence all()
Serverpublic Server all(Action<ServerSocket> action)
Serverpublic Sentence byTag(String... names)
Serverpublic Server byTag(String name, Action<ServerSocket> action)
Serverpublic Server byTag(String[] names, Action<ServerSocket> action)
Serverpublic Server onsocket(Action<ServerSocket> action)
Serverpublic void setHeartbeat(int heartbeat)
20s and should be larger than
5s.public void set_heartbeat(int _heartbeat)
Copyright 2015, The Cettia Project