Package org.jrd.backend.communication
Class Communicate
java.lang.Object
org.jrd.backend.communication.Communicate
This class opens a socket and contain methods for read and write to socket
IS/OS.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCommunicate
(String host, int port) Constructor creates a socket on given port and saves the streams into class variables. -
Method Summary
-
Field Details
-
commSocket
-
commInput
-
commOutput
-
-
Constructor Details
-
Communicate
Constructor creates a socket on given port and saves the streams into class variables.- Parameters:
host
- host nameport
- port where we open the socket
-
-
Method Details
-
close
public void close()Closes a socket. -
trimReadLine
- Throws:
IOException
-
readResponse
Method that reads agent's response.- Returns:
- "ERROR" in case of fail or corresponding bytes or class names
-
println
Sends a line with request to agent.- Parameters:
line
- "CLASSES" or "BYTES className"- Throws:
IOException
- if the write operation fails
-