|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sentilla.host.client.interfaces.HostClientService
com.sentilla.host.client.HostClient
public class HostClient
HostClient encapsulates all communication with a host server, which provides all connectivity to mote networks, and maintains network state.
Field Summary | |
---|---|
private static ClientRadioProtocol |
clientRadioProtocol
|
private static Dispatcher |
dispatcher
|
private String |
host
|
private int |
port
|
static String |
SLINGSHOT_BIN_DIR
|
private int |
timeout
|
Constructor Summary | |
---|---|
HostClient()
Create a HostClient. |
Method Summary | |
---|---|
boolean |
connect()
Attempt to open a socket connection to the host server This call will use the default server host and port, unless previously given in the HostClient constructor. |
boolean |
connect(String host,
int port)
Attempt to open a socket connection to the host server using the given server host and port. |
boolean |
connect(String host,
int port,
int timeout)
Attempt to open a socket connection to the host server using the given server host and port. |
void |
disconnect()
Disconnect from the server |
ApplicationServiceImpl |
getApplicationService()
Return an ApplicationServiceImpl client object for managing mote applications. |
int |
getDebug()
Get debug logging level |
String |
getHost()
Returns the current server hostname |
int |
getPacketsRead()
Returns the number packets read from the server since instantiation, or the last reset. |
int |
getPacketsWritten()
Returns the number packets written to the server since instantiation, or the last reset. |
int |
getPort()
Returns the current server port |
ServerAdminClientImpl |
getServerAdminClient()
Return a ServerAdmin client object for server administration. |
private void |
initDispatcher(String host,
int port)
Initialize dispatcher. |
boolean |
isConnected()
Is this HostClient currently connected to the server? |
void |
setDebug(int debugLevel)
Set debug logging level |
Methods inherited from class com.sentilla.host.client.interfaces.HostClientService |
---|
processMessage, processNetworkMessage |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String SLINGSHOT_BIN_DIR
private String host
private int port
private int timeout
private static ClientRadioProtocol clientRadioProtocol
private static Dispatcher dispatcher
Constructor Detail |
---|
public HostClient()
Method Detail |
---|
public boolean connect() throws UnknownHostException, IOException
connect
in class HostClientService
UnknownHostException
IOException
public boolean connect(String host, int port) throws UnknownHostException, IOException
connect
in class HostClientService
host
- the host server addressport
- the host server port number
UnknownHostException
IOException
public boolean connect(String host, int port, int timeout) throws UnknownHostException, IOException
connect
in class HostClientService
host
- the host server addressport
- the host server port numbertimeout
- the max milliseconds to wait for server communication
UnknownHostException
IOException
private void initDispatcher(String host, int port) throws UnknownHostException, IOException
IOException
UnknownHostException
public void disconnect() throws IOException
disconnect
in class HostClientService
IOException
public boolean isConnected()
isConnected
in class HostClientService
public String getHost()
getHost
in class HostClientService
public int getPort()
getPort
in class HostClientService
public void setDebug(int debugLevel)
setDebug
in class HostClientService
public int getDebug()
getDebug
in class HostClientService
public ApplicationServiceImpl getApplicationService()
public ServerAdminClientImpl getServerAdminClient()
public int getPacketsRead()
public int getPacketsWritten()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |