public class DefaultServer extends Object implements Server
Server
.
This implementation consumes ServerTransport
and produces
ServerSocket
following the Cettia protocol.
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 have to follow.
|
Server |
all(io.cettia.platform.action.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,
io.cettia.platform.action.Action<ServerSocket> action)
Executes the given action retrieving the socket tagged with the given
tags in this server.
|
Server |
byTag(String name,
io.cettia.platform.action.Action<ServerSocket> action)
Executes the given action retrieving the socket tagged with the given tag
in this server.
|
void |
on(ServerTransport transport) |
Server |
onsocket(io.cettia.platform.action.Action<ServerSocket> action)
Registers an action to be called when the socket has been opened 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 io.cettia.platform.action.Action<ServerTransport>
public Sentence all()
Server
public Server all(io.cettia.platform.action.Action<ServerSocket> action)
Server
public Sentence byTag(String... names)
Server
public Server byTag(String name, io.cettia.platform.action.Action<ServerSocket> action)
Server
public Server byTag(String[] names, io.cettia.platform.action.Action<ServerSocket> action)
Server
public Server onsocket(io.cettia.platform.action.Action<ServerSocket> action)
Server
public void setHeartbeat(int heartbeat)
20
s and should be larger than 5
s.public void set_heartbeat(int _heartbeat)
Copyright 2015, The Cettia Project