UDP Client socket in Visual Studio c++ ver6.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • emp
    New Member
    • Nov 2006
    • 32

    UDP Client socket in Visual Studio c++ ver6.0

    I have functioning UDP socket code written in C++ from a LINUX platform. Winsock.h or Winsock2.h

    My task is to port it to Windows. Unfortunately the development environment I have is Visual Studio 6.0 has differing constructs than the gcc compiler world on LINUX. Internet searches provide me plenty of .net solutions but nothing really for VS6.0.

    Can someone either direct me to a link that contains such info or provide a sample code snippet.

    Thanks

    -e
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    I am not an expert here but this looks like Visual Studio 6.0 could compile it: http://www.tenouk.com/Winsock/Winsock2example9.html

    Comment

    • emp
      New Member
      • Nov 2006
      • 32

      #3
      I had already looked at this link. I put pertinent pieces of this code into my app. After several compile errors I found extra .h files that needed to be included and I got it to compile, albeit with 172 warnings, all associated with the socket header files. I'm far from testing it, but..... I'm not feeling comfortable having all those warnings. You can usually live with a couple, but 172 is excessive.

      Comment

      • weaknessforcats
        Recognized Expert Expert
        • Mar 2007
        • 9214

        #4
        What kind of warnings?

        Are you using

        Code:
         #define _CRT_SECURE_NO_WARNINGS
        ?

        Comment

        • emp
          New Member
          • Nov 2006
          • 32

          #5
          The warnings reference <vector> and <bytes> and a bunch of std:: things that must just be included in various .h files.

          Comment

          • emp
            New Member
            • Nov 2006
            • 32

            #6
            Warning C4786 still persists, even with the addition of the suggested #define.

            Comment

            • weaknessforcats
              Recognized Expert Expert
              • Mar 2007
              • 9214

              #7
              C4786 is a warning that the label of your variable exceeds 255 characters and therefore cannot be used with the Visual Studio debugger. It doesn't mean anything is wring with the code. Labels bigger than 255 are common in the C++ STL.

              You might try a release build and see if the warning goes away. If it does, it's just a debugger issue. In that case I would add

              Code:
              #pragma warning(disable: 4786)
              at the beginning of the code or in a header that is included in all source files in the build.

              Comment

              • emp
                New Member
                • Nov 2006
                • 32

                #8
                It does go away in the release build. So I will add the pragma. Thanks for the help

                Comment

                Working...