CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Threaded View

  1. #1
    Join Date
    Nov 2011

    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 07:57 PM. Reason: left out information

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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.