socket
Class ClientCom
java.lang.Object
socket.ClientCom
public class ClientCom
- extends java.lang.Object
Connection to a server via stream socket, by specifying port number and IP address.
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 |
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
ClientCom
public ClientCom(java.lang.String host,
int serverPort,
java.nio.charset.Charset charSet)
throws ServerConnectionException
- Throws:
ServerConnectionException
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()