I still dont understand what I need to do. Which code is "potentially long running"? How do i make separate threads for the clients or the code?
Type: Posts; User: Asalas77
I still dont understand what I need to do. Which code is "potentially long running"? How do i make separate threads for the clients or the code?
Thank you, the debug code really helped. I put system messages after every step in debugger, server and client and this is the output:
Debugger: Starting server.
Server: Constructor running....
I was only printing to the JTextAreas and not console to check where the program stops. I changed the if statements but i dont think thats causing the problem.
When is comes to writing and...
Oh right, sorry about that. Those would be in the server:
private ArrayList<Ship> player1Ships = new ArrayList();
private ArrayList<Ship> player2Ships = new ArrayList();
...
How small? Because there's pretty much nothing left except imports, definitions and constructors plus the code I already posted.
Client:
import java.awt.*;
import java.awt.event.*;
import...
it looks like the code player_number = Integer.parseInt(inputLine); is called too soon and the server doesn't send the ID by the time, and that's why it freezes i guess. I put output1.println("1");...
I have a server connected to two clients, and I want to send messages from one to another with only one client active at a time, so after every message send it waits for response from the other...