|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfeud.clientserver.SimpleClient
This the client's counterpart to the SimpleServer. If connects to a SimpleServer and exchanges DataContainers with it.
Field Summary | |
static int |
INTERVAL
This is the time in ms that the client waits between two transfers. |
Constructor Summary | |
SimpleClient(ServerEntry se,
boolean zip,
DataContainer data)
Creates a new SimpleClient. |
|
SimpleClient(java.lang.String server,
int port,
boolean zip,
DataContainer data)
Creates a new SimpleClient. |
Method Summary | |
void |
addListener(DataTransferListener sl)
Adds a DataTransferListener to the client. |
void |
addPreProcessor(ClientPreProcessor cpp)
Adds a ClientPreProcessor to the client. |
void |
connect()
Tries to connect to the configured server. |
void |
disconnect()
Disconnects from a server. |
int |
getClientID()
Returns this client's id. |
boolean |
isConnected()
Is this client connected to a server? |
void |
setContainers(DataContainer[] c)
Sets the data to be transfered to the server in the next transfer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int INTERVAL
Constructor Detail |
public SimpleClient(java.lang.String server, int port, boolean zip, DataContainer data)
server
- the address of the server. This can be IPv4, IPv6 or a name.port
- the port on which the server is listening for clients to connectzip
- if true, all transfers (except for the login itself) will be zipped. This consumes more cpu power but reduces bandwidth usage.data
- an initial DataContainer. This container will be passed to the registered ClientLoginListeners (if any) by the server. The SimpleServer itself won't process it.public SimpleClient(ServerEntry se, boolean zip, DataContainer data)
se
- the ServerEntry (usually taken from the ServerBrowser) that holds the server's data.zip
- if true, all transfers (except for the login itself) will be zipped. This consumes more cpu power but reduces bandwidth usage.data
- an initial DataContainer. This container will be passed to the registered ClientLoginListeners (if any) by the server. The SimpleServer itself won't process it.Method Detail |
public void connect() throws java.lang.Exception
java.lang.Exception
- failed?public void disconnect()
public void addListener(DataTransferListener sl)
sl
- the listenerpublic void addPreProcessor(ClientPreProcessor cpp)
cpp
- ClientPreProcessorpublic void setContainers(DataContainer[] c)
c
- an array of DataContainerspublic int getClientID()
public boolean isConnected()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |