public class DefaultServer extends Object implements Server
Server.
This implementation consumes ServerTransport and produces
ServerSocket following the Vibe 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(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) |
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.
|
Server |
socketAction(Action<ServerSocket> action)
Registers an action to be called when the socket has been opened in this
server.
|
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 socketAction(Action<ServerSocket> action)
ServersocketAction in interface Serverpublic void setHeartbeat(int heartbeat)
20s and should be larger than 5s.public void set_heartbeat(int _heartbeat)
Copyright 2014, The Vibe Project