Web front end user login -- "the background & lt; <- a thread continued heartbeat packets sending and receiving data keep long socket TCP connection - & gt;> The service side
Web front end user exit -- "the background & lt; <-- -- -- -- -- disconnected, end thread -- -- -- -- -- & gt;> The service side
:
I use a user testing, no problem, the login is successful, the receiver data success, exit is also OK,
But when two users such as A, B all login keep communication, if A user exit, cause the failure of B user communication, see error message socket is close,
excuse me:
Please help to analysis what causes such a situation, thank you,
:
User exit background processing process:
Send out data to the server, and then the end thread, joined a whether to withdraw from the identity of the ( issysout )
Public class TxThread extends Thread {
While (true) {
If (issysout) {
System. The out. Println (" user exit from the heartbeat, exit the threads ");
return;
}
}
Is excuse me this out of the problems identified? According to my understanding, a logged in user a single thread, the end of the thread should not affect other users,
CodePudding user response:
Looks a little like, a connection is closed, all connections, or the server is closed,You check, do you have a Shared server connection closed action, is triggered,
CodePudding user response:
Your server is how to create a socket? Is don't share the same socket?Is your issysout thread own property? A Shared variable or the server?
CodePudding user response: