Package marauroa.client.net
Interface INetworkClientManagerInterface
- All Known Implementing Classes:
TCPNetworkClientManager
public interface INetworkClientManagerInterface
All network-communication is done through this interface. There are different
implementations.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddMessage(Message msg)This method add a message to be delivered to the client the message is pointed to.voidfinish()This method notify the thread to finish it executionReturns the ip address and port-numberbooleanreturns true unless it is sure that we are disconnected.getMessage(int timeout)This method returns a Message from the list or block for timeout milliseconds until a message is available or null if timeout happens.
-
Method Details
-
finish
void finish()This method notify the thread to finish it execution -
getAddress
InetSocketAddress getAddress()Returns the ip address and port-number- Returns:
- InetSocketAddress
-
getMessage
This method returns a Message from the list or block for timeout milliseconds until a message is available or null if timeout happens.- Parameters:
timeout- timeout time in milliseconds- Returns:
- a Message or null if timeout happens
- Throws:
InvalidVersionException
-
addMessage
This method add a message to be delivered to the client the message is pointed to.- Parameters:
msg- the message to be delivered.
-
getConnectionState
boolean getConnectionState()returns true unless it is sure that we are disconnected.- Returns:
- true if we may be online
-