|
-
March 9th, 2011, 04:41 AM
#1
CAsyncSocket with Timeout
Hey there,
I got a project where I should work on, which implemented a Client/Server Application, where the Client is sending a string, and the server is storing it into a file. Searching about more details, I saw that the architecture is mostly taken from this source: http://www.codeproject.com/KB/IP/MFC...82#xx3799782xx
I have three cpp files, derivated from CWinApp, CDialog and CAsyncSocket, and now I have to add a timeout on the whole thing, which means: when the Client is not sending any data for about two minutes, the connection should shut down and then open again and waiting for the Client to establish the Connection again.
I am a very C++ newbie, and I am reading articles since two or three days, but I don't get any idea how to implement it for my application. I also found something for CSocket here: http://support.microsoft.com/kb/138692 but CAsyncSocket can't use this, because it don't know the functions CancelBlockingCall() and CSocket::OnMessagePending().
Maybe anybody has a hint for me how I can go on?
Best regards,
L.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|