|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava2gomd.GomdClient
The connection to the Gomd daemon
Hashtable
Constructor Summary | |
GomdClient(java.lang.String gomd_hostname,
int gomd_port)
Creates a GomdClient, the connection to the Gomd daemon |
Method Summary | |
void |
close()
Detaches the input and output streams and then closes the connection. |
boolean |
connect()
Connects to the remote Gomd and attaches the input and output streams |
protected void |
finalize()
Called by java's garbage collector when removed Calls close() to close the connection neatly. |
long |
getBytesReceived()
Returns the number of bytes received by this connection |
long |
getBytesSent()
Returns the number of bytes sent by this connection |
java.lang.String[] |
grep(java.lang.String pattern)
Filters the user-specified value from Gomd's reply |
void |
send(java.lang.String data)
Sends a user-specified string |
void |
setAddress(java.lang.String hostname,
int port)
Sets the address and port of the Gomd to connect to. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GomdClient(java.lang.String gomd_hostname, int gomd_port) throws java.io.IOException
gomd_hostname
- The hostname or IPv4 address to connect togomd_port
- The port on wich Gomd is listeningMethod Detail |
public void setAddress(java.lang.String hostname, int port)
hostname
- The hostname or IPv4-address to connect toport
- The port on wich Gomd is listeningpublic boolean connect() throws java.net.UnknownHostException, java.io.IOException
java.net.UnknownHostException
java.io.IOException
protected void finalize() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
public void send(java.lang.String data)
data
- The String to send to Gomdpublic java.lang.String[] grep(java.lang.String pattern) throws java.io.IOException
pattern
- The value to return
GomdClient.send("get pidlist 257");
GomdClient.grep("PIDS_LIST");
java.io.IOException
public long getBytesReceived()
public long getBytesSent()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |