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

CodePudding user response:

reference 1st floor bree06 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 the child thread
hello, thank you, is not terminated, through other ways can I listen to this block, and then for other operation, I tried to read timeout before, but will affect the procedures, I this is interactive communication for many times, I this is multithreaded, but this is not the child thread

CodePudding user response:

Problem solved, please? I also encountered similar problems
  • Related