I am trying to create a server socket to listen to a client input stream, but when I When using socket technology, So, you can take a look at this to run the whole thing. Within the 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?
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.
run () method
connection handler , you will be related to your user object.
No comments:
Post a Comment