Skip to content
Snippets Groups Projects
Commit 053bfaed authored by Elrabu's avatar Elrabu
Browse files

Add: Server Testing methods added.

parent 5a555c48
No related branches found
No related tags found
2 merge requests!35Update: Added more Stuff to be transported over the server.,!2Merge of Multiplayer Feature into development branch
......@@ -7,7 +7,8 @@ public class ConnectionHandling {
public static void main(String[] args) throws IOException {
Client client = new Client();
client.startConnection("localhost", 45371);
String response = client.sendMessage("hello server");
System.out.println("Response: " + response);
String response = client.sendMessage("hello");
System.out.println(response);
}
}
......@@ -33,11 +33,14 @@ public class Server {
in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
String greeting = in.readLine();
if ("hello server".equals(greeting)) {
out.println("hello client");
String message = "Your Message was: " + greeting;
if ("hello".equals(greeting)) {
out.println("hello client " + message);
}
else {
out.println("unrecognised greeting");
out.println("unrecognised greeting " + message);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment