|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
M
- the type of messages that can be transmitted through the
infrastructure between a client and a server.public interface Infrastructure<M extends Message>
The interface representing a communication infrastructure on which a client can connect to a listening server and communicates.
An infrastructure may be synchronous or asynchronous. In the former case, messages are sent and processed before the control returns and the whole catp system, including the game server and the clients, is typically in a single-threaded process, while in the latter case, messages are sent and the control immediately returns and there are multiple threads with each for the game server or one of the clients.
For example, SocketBasedInfrastructureImpl
and
QueueBasedInfrastructureImpl
are asynchronous, and
CallBasedInfrastructureImpl
is synchronous.
SocketBasedInfrastructureImpl
is used in a distributed actual
competition, and CallBasedInfrastructureImpl
can speed up the
execution of an experiment significantly.
Method Summary | |
---|---|
void |
cleanUp()
cleans up after finishing using this infrastructure. |
ClientConnector<M> |
createClientConnector()
can be invoked by a GameClient to create a
ClientConnector so as to connect to a
GameServer . |
ServerConnector<M> |
createServerConnector()
can be invoked by a GameServer to create a
ServerConnector so as to be able to wait for connection requests
from GameClient s. |
boolean |
isSynchronous()
|
Method Detail |
---|
ClientConnector<M> createClientConnector()
GameClient
to create a
ClientConnector
so as to connect to a
GameServer
.
ClientConnector
ServerConnector<M> createServerConnector()
GameServer
to create a
ServerConnector
so as to be able to wait for connection requests
from GameClient
s.
ServerConnector
boolean isSynchronous()
void cleanUp()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |