Home > Back-end > InputStream is=socket. GetInputStream (); Is the read () blocking the how to solve
InputStream is=socket. GetInputStream (); Is the read () blocking the how to solve
Time:03-30
Resolution on the client server sends the message, we don't have the right to modify the code from the server, excuse me, in the client how to modify, when blocking termination procedure to proceed, thank you
CodePudding user response:
If the socket getInputStream (); In the main thread is blocked, you can't be terminated, if it is in the child thread reads the main thread can call the stop () method to terminate threads