mirror of
https://github.com/2OOP/pism.git
synced 2026-02-04 19:04:49 +00:00
Added TcpServerTest
This commit is contained in:
@@ -202,6 +202,12 @@ public class ParsedCommand {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.originalCommand; // TODO: Maybe return more info.
|
||||
}
|
||||
|
||||
//
|
||||
// public ParsedCommand parseCommand(String command) {
|
||||
// return null;
|
||||
|
||||
@@ -76,7 +76,7 @@ public final class ServerConnection extends TcpClient implements Runnable {
|
||||
this.executor.shutdownNow();
|
||||
}
|
||||
|
||||
private void inputLoop() {
|
||||
void inputLoop() {
|
||||
logger.info("Starting {}:{} connection read", this.serverAddress, this.serverPort);
|
||||
try {
|
||||
while (running) {
|
||||
@@ -96,7 +96,7 @@ public final class ServerConnection extends TcpClient implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
private void outputLoop() {
|
||||
void outputLoop() {
|
||||
logger.info("Starting {}:{} connection write", this.serverAddress, this.serverPort);
|
||||
try {
|
||||
while (this.running) {
|
||||
|
||||
@@ -40,11 +40,11 @@ public abstract class TcpClient {
|
||||
this.socket.close();
|
||||
}
|
||||
|
||||
private BufferedReader createIn() throws IOException {
|
||||
BufferedReader createIn() throws IOException {
|
||||
return new BufferedReader(new InputStreamReader(this.socket.getInputStream()));
|
||||
}
|
||||
|
||||
private PrintWriter createOut() throws IOException {
|
||||
PrintWriter createOut() throws IOException {
|
||||
return new PrintWriter(this.socket.getOutputStream(), true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user