I am trying to create a server socket to listen to a client input stream, but when I start_listening Execute () method, my program is stuck. I also tried to remove the loop, but I still have the same problem. I think this customer is waiting for the conversation. Is listening to the program an alternative way, while the program is also working?
When using socket technology, accept () blocks the execution of existing threads until a client is connected to the listening socket. This is a defined behavior: "The method blocks [ acceptance] ] until a connection is made." Running the server in endless loop can be okay.
So, you can take a look at this to run the whole thing. Within the run () method connection handler , you will be related to your user object.
No comments:
Post a Comment