NON-BLOCKING sockets without the windows message loop?
Posted on 2004-10-21
OK here is my situation...
I am writing a DLL that will be accessed by a client application. This is for a chat application btw, the DLL will handle everything, and will notify the client when chat text is recieved, but other than that, the client has no involvement with the DLL...
within the DLL, I am creating a socket connection to connect to the server. Here is my problem. Obviously I will need a non-blocking sockets system... I have tried using the Windows API method, where windows posts messages like FD_RECIEVE for specific events, but my problem is this. In order to set up this method, it requires my DLL to create a window, and set up a window procedure just to recieve a couple of FD_ events. Is there any other method in which I can use non-blocking sockets, without having to create a window?
The problem with creating a window comes when I am in debugging mode. Sometimes RegisterClass will fail for no reason, other times it will run... so if at all possible, I would like to find another method...
so a solution to this problem would be either
1) some kind of method to continue to recieve the windows FD_ events to my DLL's WindowProcedure, without having to create a window
2) if there is no way for method 1, some other method of using non-blocking sockets, WITHOUT polling
thanks for the help