|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.sphinx.util.SocketCommandClient
A client for a socketed command interpreter. Hooks up to a socketed command interpreter and allows the sending of commands.
CommandInterpreter
Constructor Summary | |
SocketCommandClient()
Creats a SocketCommandClient with no connection open must be called. |
|
SocketCommandClient(java.lang.String host,
int port)
Creates a socket command client at the given host and port. |
Method Summary | |
void |
close()
Closes the socket connection |
java.lang.String |
getResponse()
Gets a response |
int |
getSoTimeout()
Returns the SO_TIMEOUT of the Socket that this client uses. 0 returns implies that the option is disabled (i.e., timeout of infinity). |
boolean |
isResponse()
is a response |
static void |
main(java.lang.String[] args)
manual tester for the command interpreter. |
void |
open(java.lang.String aHost,
int aPort)
Opens a socket connection |
boolean |
sendCommand(java.lang.String command)
sends a command, retries on error which will attempt to repair a dead socket |
java.lang.String |
sendCommandGetResponse(java.lang.String command)
sends a command get a response |
void |
setSoTimeout(int millisecs)
Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SocketCommandClient(java.lang.String host, int port) throws java.io.IOException
host
- the host machineport
- the port to usepublic SocketCommandClient()
Method Detail |
public void open(java.lang.String aHost, int aPort) throws java.io.IOException
aHost
- the host to connect toaPort
- the port to connect to
java.io.IOException
- if connection failspublic int getSoTimeout() throws java.net.SocketException
java.net.SocketException
public void setSoTimeout(int millisecs) throws java.net.SocketException
millisecs
- the timeout in milliseconds
java.net.SocketException
public boolean sendCommand(java.lang.String command)
command
- the command
public java.lang.String getResponse()
public boolean isResponse()
public java.lang.String sendCommandGetResponse(java.lang.String command)
command
- the command to send
public void close()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |