Package com.github.perdia.tcp
Class TCPClient
java.lang.Object
com.github.perdia.tcp.TCPClient
Class for connecting to as well as writing and receiving data from the server socket Perdia-DB is running on
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
TCPClient
Constructor for the TCPClient class- Parameters:
host
- The hostname or IP-address of the serverport
- The port on the server the client is supposed to connect to
-
-
Method Details
-
write
public void write(byte[] text) Sends the given data to the Perdia-DB server. If the given server socket does not exist, is offline or refusing connection, an IOException is thrown and caught.- Parameters:
text
- Byte array containing the single characters of the query text encoded in UTF-8
-
read
public byte[] read()Receives data sent by the Perdia-DB server. If the given server socket does not exist, is offline or refusing connection, an IOException is thrown and caught.- Returns:
- Byte array containing the single characters of the query text encoded in UTF-8
-