public class Communicate extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_ADDRESS |
Constructor and Description |
---|
Communicate(String host,
int port)
Constructor creates a socket on given port and saves the streams into
class variables.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes a socket.
|
void |
println(String line)
Sends a line with request to agent.
|
String |
readResponse()
Method that reads agent's response.
|
public static final String DEFAULT_ADDRESS
public Communicate(String host, int port)
host
- host nameport
- port where we open the socketpublic void close()
public String readResponse()
public void println(String line) throws IOException
line
- "CLASSES" or "BYTES className"IOException
- if the write operation failsCopyright © 2019. All rights reserved.