MFC CAsyncSocket OnClose Does Not Occur

Asked 2 years ago, Updated 2 years ago, 104 views

Thank you for your help.

in server and multi-client connection configurations MFC is creating socket communication

Server (Listen side) on OnClose from client (Connect side)
Socket communication has been terminated.
Occasionally, OnClose callbacks do not occur

If there are any possible causes,
Could you teach me?

mfc

2022-09-30 19:28

1 Answers

The other party calls CAsyncSocket::ShutDown and it is not until it has received it correctly. CAsyncSocket:::OnClose occurs, so there are a number of possible causes, such as not ringing, being closed before the call ends, or not being sent due to a communication failure.

By doing Keep-Alive, you may be able to detect the other party's absence.


2022-09-30 19:28

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.