public interface CommunicationService
| Modifier and Type | Method and Description |
|---|---|
<T> void |
addSerializer(Class<T> clazz,
Serializer<T> serializer)
Adds a data type serializer used for socket connections.
|
<T> SimulationSocket<T> |
beginConnect(String name,
Class<T> clazz)
Creates a client socket and begins connection to the given socket name,
using the given object class for transfer.
|
<T> SimulationServerSocket<T> |
createServerSocket(String name,
Class<T> clazz)
Creates a server socket listening under the given name for connections,
being able to transfer objects of the given class.
|
Integer |
getDownlinkRate(String name)
Returns the current downlink byte rate for the given socket.
|
Integer |
getUplinkRate(String name)
Returns the current uplink byte rate for the given socket.
|
void |
setRates(String name,
Integer uplink,
Integer downlink)
Sets the upink/downlink byte rates for the given socket.
|
<T> SimulationServerSocket<T> createServerSocket(String name, Class<T> clazz) throws IOException
name - the socket nameclazz - the class transferred over the socketIOException - if the name is already in use<T> SimulationSocket<T> beginConnect(String name, Class<T> clazz) throws IOException
name - the socket name to connect toclazz - the class transferred over the socketIOException - if the name is not in use or the server socket uses an
incompatible data typevoid setRates(String name, Integer uplink, Integer downlink)
name - the name of the socket to set ratesuplink - the uplink rate in bytes per tickdownlink - the downlink rate in bytes per tick<T> void addSerializer(Class<T> clazz, Serializer<T> serializer)
clazz - the class to serializeserializer - the serializer to useInteger getUplinkRate(String name)
name - the socket namenull if unlimitedCopyright © 2015. All rights reserved.