November 27th, 2011, 08:54 PM
simple winsock server advice
I need to write some simple server Winsock code. (Yes, I understand the irony.) One thread, one connection, host A to host B, non blocking. I don’t have the expertise to take these do everything multi-threaded example classes and merge them into my MFC project. Where can I find a simple description or example?
I used a vendor starter application (MFC, C++ project template) to fetch telemetry data from the vendor A’s application. Now I need to send the telemetry data, one to three megabytes per second, directly to vendor B’s server application for display. The vendor B system is a server to multiple client display computers, but turns out that it expects my application to take the role of server to its client. (Makes sense, my app is providing the data, it is consuming the data.)
Vendor B has an example TCP class for my server end but it uses blocking mode and there are several difficulties. Their client receiving app is not robust and intentionally breaks the connection as least once, and maybe frequently. The code keeps getting hung somewhere and determining the problem is quite difficult. It seems to me that if the code on my end were non-blocking I could get it to update the dialog and tell me what it is trying to do. Vendor B is not sympathetic to my request for non-blocking advice. Wiresharking the packets to find the error in my application is proving difficult.
I can find and read about all the asynchronous calls, but don’t know how to set up the callbacks and messages needed for the Winsock class to sense problems with the connection and take action. Integrating into an existing MFC project is difficult.
Pointers to some good explanations and tutorial are requested. In the meantime, I continue searching and reading.
Edit: Oops, left out: Windows XP Pro, Visual Studio 2008, MFC, C++, TCP/IP communications
Last edited by bkelly; November 27th, 2011 at 08:57 PM.
Reason: left out information
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!