Java TCP server cannot receive message from more than one client

前端 未结 1 345
星月不相逢
星月不相逢 2021-01-27 05:03

I am going for the simplest explanation. My Java TCP project has a server and three clients.

The server has a ClientThread. The clients each has a ServerThread and a Use

1条回答
  •  一生所求
    2021-01-27 05:21

    I think I have found the problem. I was using the same socket for a client program's ServerThread and UserThread. So while the ServerThread is trying to response to the server, most probably the message is going to another different thread in the server that is listening for message (thinking the message comes from UserThread) through the same socket.

    0 讨论(0)
提交回复
热议问题