Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Socket programming error MFC

Socket programming error MFC

Scheduled Pinned Locked Moved C / C++ / MFC
sysadminhelpcsharpc++
8 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Aqueel
    wrote on last edited by
    #1

    Hi I am doing network programming in MFC. Problem is that i am trying to send a buffer to server using send(...) function. But there is an error. When i use WSAGetLastError() to check error code, it gives error code 0. Please can anyone tell me where can problem lie. Thank you We Believe in Excellence www.aqueelmirza.cjb.net

    D S 2 Replies Last reply
    0
    • A Aqueel

      Hi I am doing network programming in MFC. Problem is that i am trying to send a buffer to server using send(...) function. But there is an error. When i use WSAGetLastError() to check error code, it gives error code 0. Please can anyone tell me where can problem lie. Thank you We Believe in Excellence www.aqueelmirza.cjb.net

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Aqueel wrote:

      Problem is that i am trying to send a buffer to server using send(...) function. But there is an error.

      And that error would be what?


      "The largest fire starts but with the smallest spark." - David Crow

      "Judge not by the eye but by the heart." - Native American Proverb

      A 1 Reply Last reply
      0
      • D David Crow

        Aqueel wrote:

        Problem is that i am trying to send a buffer to server using send(...) function. But there is an error.

        And that error would be what?


        "The largest fire starts but with the smallest spark." - David Crow

        "Judge not by the eye but by the heart." - Native American Proverb

        A Offline
        A Offline
        Aqueel
        wrote on last edited by
        #3

        Yah i just wanted to know that in which scenerio, 0 is returned. what can be problem? I went on msdn. There is a list of error codes. But they are lables not integer values. How can i determine this one. Thank you We Believe in Excellence www.aqueelmirza.cjb.net -- modified at 10:33 Wednesday 7th June, 2006

        D V 2 Replies Last reply
        0
        • A Aqueel

          Hi I am doing network programming in MFC. Problem is that i am trying to send a buffer to server using send(...) function. But there is an error. When i use WSAGetLastError() to check error code, it gives error code 0. Please can anyone tell me where can problem lie. Thank you We Believe in Excellence www.aqueelmirza.cjb.net

          S Offline
          S Offline
          Sarath C
          wrote on last edited by
          #4

          if it is a network related error u will definitely get the error code. check your code first. i think there should have some problems with your code. r u using multiple threads? CSocket is designed to serve for per thread basis. if u r creating a sample application. follow the steps provided in MSDN. for the basic implementation, u can try with the sample code provided in MSDN SaRath.
          "Don't Do Different things... Do Things Differently..." Understanding State Pattern in C++

          1 Reply Last reply
          0
          • A Aqueel

            Yah i just wanted to know that in which scenerio, 0 is returned. what can be problem? I went on msdn. There is a list of error codes. But they are lables not integer values. How can i determine this one. Thank you We Believe in Excellence www.aqueelmirza.cjb.net -- modified at 10:33 Wednesday 7th June, 2006

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            Aqueel wrote:

            There is a list of error codes. But they are lables not integer values. How can i determine this one.

            Have you looked in winerror.h?


            "The largest fire starts but with the smallest spark." - David Crow

            "Judge not by the eye but by the heart." - Native American Proverb

            1 Reply Last reply
            0
            • A Aqueel

              Yah i just wanted to know that in which scenerio, 0 is returned. what can be problem? I went on msdn. There is a list of error codes. But they are lables not integer values. How can i determine this one. Thank you We Believe in Excellence www.aqueelmirza.cjb.net -- modified at 10:33 Wednesday 7th June, 2006

              V Offline
              V Offline
              Viorel
              wrote on last edited by
              #6

              After you obtained the error code with "DWORD error = WSAGetLastError();" and stopped the program at a breakpoint, you can see a textual description of the error by adding the following value to Watch panel or QuickWatch window: "error,hr".

              A 1 Reply Last reply
              0
              • V Viorel

                After you obtained the error code with "DWORD error = WSAGetLastError();" and stopped the program at a breakpoint, you can see a textual description of the error by adding the following value to Watch panel or QuickWatch window: "error,hr".

                A Offline
                A Offline
                Aqueel
                wrote on last edited by
                #7

                Sorry i debugged it and saw that error code is 183. What is that? We Believe in Excellence www.aqueelmirza.cjb.net

                V 1 Reply Last reply
                0
                • A Aqueel

                  Sorry i debugged it and saw that error code is 183. What is that? We Believe in Excellence www.aqueelmirza.cjb.net

                  V Offline
                  V Offline
                  Viorel
                  wrote on last edited by
                  #8

                  In Winerror.h file, 183 is the code of ERROR_ALREADY_EXISTS error: "Cannot create a file when that file already exists". Perhaps you are trying to open a socket on already used port? Or may be you are performing some invalid file operations.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups