srikbond
December 6th, 2004, 11:25 PM
Hi,
I have developed an application using an overridden CAsyncSocket class to acquire data from a server. Now I need to get data from more than a single server. If I use multiple sockets for the client, I don't know how to distinguish which socket's OnConnect( ), OnSend( ) etc events are called. Is there some kind of way to identify the individual sockets? I tried adding an id datamember to the derived class and initialise it whenever I create and connect a new socket. But I still dont know how to retrieve its value in the OnConnect( ) etc as they seem to be event handlers and use if the "this" pointer doesn't work as they aren't member functions.
Any insight ?
I have developed an application using an overridden CAsyncSocket class to acquire data from a server. Now I need to get data from more than a single server. If I use multiple sockets for the client, I don't know how to distinguish which socket's OnConnect( ), OnSend( ) etc events are called. Is there some kind of way to identify the individual sockets? I tried adding an id datamember to the derived class and initialise it whenever I create and connect a new socket. But I still dont know how to retrieve its value in the OnConnect( ) etc as they seem to be event handlers and use if the "this" pointer doesn't work as they aren't member functions.
Any insight ?