Strange prob with Socket CAsyncSocket
-
Hi. I have a straneg prob. I wrote a program that has a CAsyncOScket derived socket class. I will try to reconnect to a server every 1-3 sec IF it did not succeed in connecting or was disconnected. I keep track of the socket if after three sec and it DOES Not succeed, it will call Close on the present socket and then will call on the Create and then call on the Connect call. It will do this repeatedly until connection. Now, this should be pretty simple. But I am get a "Socket Notification Sink" dialog with error that says it can not write to some memory location. I am not sure whether I am approaching how to deal with what I want to do or maybe I am missing to call something else. Has anyone ever got this error? Thanks in advance.
-
Hi. I have a straneg prob. I wrote a program that has a CAsyncOScket derived socket class. I will try to reconnect to a server every 1-3 sec IF it did not succeed in connecting or was disconnected. I keep track of the socket if after three sec and it DOES Not succeed, it will call Close on the present socket and then will call on the Create and then call on the Connect call. It will do this repeatedly until connection. Now, this should be pretty simple. But I am get a "Socket Notification Sink" dialog with error that says it can not write to some memory location. I am not sure whether I am approaching how to deal with what I want to do or maybe I am missing to call something else. Has anyone ever got this error? Thanks in advance.
Hi use a pointer to CAsyncSocket & use new to create a instant of socket then after close delete the old one and create new CAsyncSocket instant. it maybe work!:^) Iman Ghasrfakhri