Search:

Type: Posts; User: Asalas77

Search: Search took 0.22 seconds.

  1. Re: Client and server socket conection - how to send IDs to clients

    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?
  2. Re: Client and server socket conection - how to send IDs to clients

    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....
  3. Re: Client and server socket conection - how to send IDs to clients

    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...
  4. Re: Client and server socket conection - how to send IDs to clients

    Oh right, sorry about that. Those would be in the server:



    private ArrayList<Ship> player1Ships = new ArrayList();
    private ArrayList<Ship> player2Ships = new ArrayList();
    ...
  5. Re: Client and server socket conection - how to send IDs to clients

    Done that.
  6. Re: Client and server socket conection - how to send IDs to clients

    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...
  7. Client and server socket conection - how to send IDs to clients

    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");...
  8. Client and server socket conection - how to send IDs to clients

    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...
Results 1 to 8 of 8