socket
Class ClientCom

java.lang.Object
  extended by socket.ClientCom

public class ClientCom
extends java.lang.Object

Connection to a server via stream socket, by specifying port number and IP address.


Field Summary
private  java.nio.charset.Charset charSet
           
(package private) static java.nio.charset.Charset DEFAULT_CHARSET
           
(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
ClientCom(java.lang.String host, int serverPort, java.nio.charset.Charset charSet)
           
 
Method Summary
 void close()
           
 java.lang.String getParseTree()
           
private  void init(java.lang.String serverHost, int serverPort, java.nio.charset.Charset charSet)
           
 void reconfigure(java.nio.charset.Charset charSet)
           
 java.lang.String sendRequest(java.lang.String request)
           
 
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

DEFAULT_CHARSET

static final java.nio.charset.Charset DEFAULT_CHARSET

serverHost

java.lang.String serverHost

serverPort

int serverPort

socketClient

java.net.Socket socketClient

outPrintWriter

java.io.PrintWriter outPrintWriter

inBufferedReader

java.io.BufferedReader inBufferedReader

charSet

private java.nio.charset.Charset charSet

syncObject

private static java.lang.Object syncObject
Constructor Detail

ClientCom

public ClientCom(java.lang.String host,
                 int serverPort,
                 java.nio.charset.Charset charSet)
          throws ServerConnectionException
Throws:
ServerConnectionException
Method Detail

init

private void init(java.lang.String serverHost,
                  int serverPort,
                  java.nio.charset.Charset charSet)
           throws ServerConnectionException
Throws:
ServerConnectionException

reconfigure

public void reconfigure(java.nio.charset.Charset charSet)
                 throws java.io.IOException
Throws:
java.io.IOException

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

getParseTree

public java.lang.String getParseTree()