Commit 6fd5dcec authored by legoc's avatar legoc
Browse files

Removed some useless methods

parent d5eac3fb
......@@ -171,26 +171,6 @@ public class Server {
return false;
}
public void sendSync() {
try {
requestSocket.requestJSON(Messages.createSyncRequest());
} catch (ConnectionTimeout e) {
// do nothing
}
}
public void sendSyncStream(String name) {
try {
requestSocket.requestJSON(Messages.createSyncStreamRequest(name));
} catch (ConnectionTimeout e) {
// do nothing
}
}
private void retrieveServerVersion() {
......@@ -311,14 +291,6 @@ public class Server {
return new Response(JSON.getInt(response, Messages.RequestResponse.VALUE), JSON.getString(response, Messages.RequestResponse.MESSAGE));
}
public int getStreamPort(String name) throws ConnectionTimeout {
JSONObject request = Messages.createOutputPortRequest(name);
JSONObject response = requestSocket.requestJSON(request);
return JSON.getInt(response, Messages.RequestResponse.VALUE);
}
/**
* Sends start request with parameters and Result object.
* If the outputStream argument is true, then if the application has enabled output stream, an OutputStreamSocket is created.
......@@ -666,13 +638,21 @@ public class Server {
return result;
}
private int getStreamPort(String name) throws ConnectionTimeout {
JSONObject request = Messages.createOutputPortRequest(name);
JSONObject response = requestSocket.requestJSON(request);
return JSON.getInt(response, Messages.RequestResponse.VALUE);
}
private OutputStreamSocket createOutputStreamSocket(String name) {
OutputStreamSocket outputStreamSocket = new OutputStreamSocket(name);
int port = getStreamPort(name);
if (port == -1) {
return null;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment