Now if the exit system according to the exit after I login system, but the client don't know how to respond to the connection disconnect message,
Tried to register libssh2_session_callback_set LIBSSH2_CALLBACK_DISCONNECT callback function, and also couldn't get to the callback,
After the server disconnected, channel write or perform (oddly) success, also unable to determine connection broken by the way,
Consult everybody who is there any way to determine active server disconnected
CodePudding user response:
Personal guess ha, get a thread libssh2_channel_wait_closed?Not to use the underlying WSAEventSelect recognised & amp; Monitor FD_CLOSE events
CodePudding user response:
Try:LIBSSH2_POLLFD_SESSION_CLOSED
LIBSSH2_POLLFD_CHANNEL_CLOSED
CodePudding user response:
The server disconnected need disconnect? If an exception is disconnected, there is no news??CodePudding user response:
https://stackoverflow.com/questions/12981125/libssh2-session-cleanup-without-blockingThe second answer is likely to be useful, he seems to trigger recv, but reading byte 0, through the remote disconnect, network part seems similar to ordinary socket, it's just a deal,
CodePudding user response: