socket
Class svm_client

java.lang.Object
  extended by socket.svm_client

public class svm_client
extends java.lang.Object

Connection to svm_light_server via stream socket, by specifying port number and IP address.
In order to call the classification server, establish a TCP connection to it on the given port. Then, write the test instance file (as specified at http://svmlight.joachims.org) followed by a '!'. The server will send back the predictions file. '\n' should be used for all end-line sequences.


Field Summary
(package private)  java.io.BufferedReader inBufferedReader
           
(package private) static java.lang.String lineSeparator
           
static java.util.logging.Logger logger
           
(package private)  java.io.PrintWriter outPrintWriter
           
(package private)  java.lang.String serverHost
           
(package private)  int serverPort
           
(package private)  java.net.Socket socketClient
           
private static java.lang.Object syncObject
           
 
Constructor Summary
svm_client(java.lang.String host, int serverPort)
           
 
Method Summary
 void close()
           
private  void init(java.lang.String serverHost, int serverPort)
          Method used for initialisation.
static void main(java.lang.String[] argv)
           
 java.lang.String sendRequest(java.lang.String request)
           
protected  java.lang.String sendRequestToServer(java.lang.String msg4Server)
          Invokes the dialogue server to process the N-best list (previously received from the regServer)
private static void startClient(java.lang.String host, int serverPort)
          Testing if the connection to the svm_light server can be done.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static java.util.logging.Logger logger

lineSeparator

static final java.lang.String lineSeparator

serverHost

java.lang.String serverHost

serverPort

int serverPort

socketClient

java.net.Socket socketClient

outPrintWriter

java.io.PrintWriter outPrintWriter

inBufferedReader

java.io.BufferedReader inBufferedReader

syncObject

private static java.lang.Object syncObject
Constructor Detail

svm_client

public svm_client(java.lang.String host,
                  int serverPort)
           throws ServerConnectionException
Throws:
ServerConnectionException
Method Detail

init

private void init(java.lang.String serverHost,
                  int serverPort)
           throws ServerConnectionException
Method used for initialisation.

Parameters:
serverHost -
serverPort -
charSet -
Throws:
ServerConnectionException
See Also:
of this class.

sendRequest

public java.lang.String sendRequest(java.lang.String request)
                             throws ServerConnectionException
Throws:
ServerConnectionException

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

startClient

private static void startClient(java.lang.String host,
                                int serverPort)
Testing if the connection to the svm_light server can be done.


sendRequestToServer

protected java.lang.String sendRequestToServer(java.lang.String msg4Server)
Invokes the dialogue server to process the N-best list (previously received from the regServer)

Parameters:
msg4DialogueServer - message to be send to the dialogue server
Returns:
reply from the dialogue server

main

public static void main(java.lang.String[] argv)