I would like to use the CAsyncSocket class for socket support in a console app that links to MFC. However, after creating the socket and binding it to a port, the console program terminates. I understand why, because the main function is allowed to exit.
I guess I need some kind of while loop to act as a message pump for the console program.
So my question(s) are:
1. What do I put inside the while loop, to keep the service running until it is terminated, and to allow the framework to call the OnConnect, OnReceive, OnClose, etc. of CAsyncSocket?
2. (related) How do I keep the while loop from using up the entire time slice-- and thus bringing the system to a crawl
TIA
Will
I guess I need some kind of while loop to act as a message pump for the console program.
So my question(s) are:
1. What do I put inside the while loop, to keep the service running until it is terminated, and to allow the framework to call the OnConnect, OnReceive, OnClose, etc. of CAsyncSocket?
2. (related) How do I keep the while loop from using up the entire time slice-- and thus bringing the system to a crawl
TIA
Will