February 2nd, 2011, 01:07 PM
Studio 2010 async socket example
Does anyone know, why the old client-server example Chatter (=client) and ChatSrvr (=server) is removed from the Microsoft examples?
I have used this peace of code, years ago ; several times and on several computers with C++ version 6.00. It worked fine!
Now I have Studio 2010. Chatter and Chatsrvr are no longer in de example list...
I can convert the old programs when i'm loading the projects in studio 2010.
The programs even run! And the even work...but only for a couple of minutes. When the clients sends a message to the server the server is not receiving anything. (The first 20(?) or 60(?) message are received without any problem.)
I can't figure out why the socket stops. Can anyone give me a hint?
Things I have tried so far:
1) keep alive functionanlity added. The communication stops after x- time.
2) checking for something called 'blocking'. The error codes tell me the socket is NOT blocking.
3) If have simplified the data send (Class CMsg) to 'int', to avoid problems of lost pointers/static etc.
4) I have tried to let studio 2010 use .net foundation versie 3.5 instead of the new 4.0. I cann't make that work because I don't have studion 2005/2008. So I don't know if this will solve my problem.
5) I have noticed the winsock.h is now win2sock.h. I don't know the differences between them. Does anyone know winsock2 is not upwards compatible with winsock?
6) I have tried to debug the system. I'm sure the client is sending messages, but somehow the server doesn't get a on-recieve message.
7) Compiling the code with my old c++ 6.00 compiler makes perfect programms. So I think the code itself must be good. (It is microsoft example code....)
8) I have been seeking for c++ async client/server example code using archives, but I can't find anything like Chatter/Chatsrvr.
Now I don't know what to do. Using my old compiler could be an option, but it is even now no longer supported by microsoft...and I want to be up-to-date of course...!
Any suggestions are welcome to solve my problem.
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!