|
@ -21,9 +21,16 @@ class TCPServer { |
|
|
BufferedReader inFromClient = new BufferedReader(new InputStreamReader(connectionSocket.getInputStream())); |
|
|
BufferedReader inFromClient = new BufferedReader(new InputStreamReader(connectionSocket.getInputStream())); |
|
|
DataOutputStream outToClient = new DataOutputStream(connectionSocket.getOutputStream()); |
|
|
DataOutputStream outToClient = new DataOutputStream(connectionSocket.getOutputStream()); |
|
|
|
|
|
|
|
|
clientSentence = inFromClient.readLine(); |
|
|
|
|
|
capitalizedSentence = clientSentence.toUpperCase() + '\n'; |
|
|
|
|
|
outToClient.writeBytes(capitalizedSentence); |
|
|
|
|
|
|
|
|
// Try/Catch hinzugefügt, nachdem bei Einsatz Amazon AWS (Healthcheck des ELB) clientSentence null war |
|
|
|
|
|
try { |
|
|
|
|
|
clientSentence = inFromClient.readLine(); |
|
|
|
|
|
capitalizedSentence = clientSentence.toUpperCase() + '\n'; |
|
|
|
|
|
outToClient.writeBytes(capitalizedSentence); |
|
|
|
|
|
} catch (IOException ioe) { |
|
|
|
|
|
ioe.printStackTrace(); |
|
|
|
|
|
} catch (NullPointerException npe) { |
|
|
|
|
|
npe.printStackTrace(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |