mgonyea
asked on
MSVC++6.0 - Socket Programming
I have written a CClientSocket class (based on the CAsyncSocket class) which I'm trying to use for socket communications. The CClientSocket object overrides the OnReceive, OnConnect, etc events. I would like to know how to notify my main program that the OnReceive event (and others) have fired. Is there a nice, neat way of doing this, or do I need to send, perhaps, a custom message to my program?
Thanks.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I will probably use Message posting on the server side(s) of the socket, but the client program creates only one socket. I'm just in the middle of implementing an inline function that might do the trick.
Thanks....brb.
Thanks....brb.
if u are using CAsyncSocket then there is no need to make threads.
i normally keep my sockets stack inside document and views are informed on certain events.
i normally keep my sockets stack inside document and views are informed on certain events.
> More thread safely...
If you wish to achieve thread safety you can use Critical Sections and Mutexes etc however this is inly realy useful when setting and getting data and not where the CSocket methods are concerned
If you wish to achieve thread safety you can use Critical Sections and Mutexes etc however this is inly realy useful when setting and getting data and not where the CSocket methods are concerned
If your socket is running in different thread, better post a thread message then calling a method of the main object.
More thread safely...