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. Windows API
  4. [solved]winsock keep encounter 10053 error

[solved]winsock keep encounter 10053 error

Scheduled Pinned Locked Moved Windows API
helpcomsysadminlinuxquestion
8 Posts 3 Posters 25 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.
  • L Offline
    L Offline
    lynus_zhu
    wrote on last edited by
    #1

    hi, my code keep encounter the 10053 error when running in windows7 but works fine in winXP. what might be wrong? here is my code http://paste.ubuntu.com/7456583/ and here is the output: http://paste.ubuntu.com/7456610/ the error is always happens in the loop:

    for (j=0;j<10000;j++) {
    sprintf(buf,"%d,%d,%d\n",0,0,0);
    sendall(sock,buf,strlen(buf),__LINE__);
    readall(sock,buf,4,__LINE__);
    n = *(int *)buf;
    assert(n==4);
    /*for (int ii=0;ii<n;ii++) {
    readall(sock,buf,16,__LINE__);
    }*/
    readall(sock,buf,64,__LINE__);
    std::cout<<"j= "<<j<<std::endl;
    Sleep(1000);
    }

    BTW, the server side will not close socket. UPDATE:I used wireshark to notice that the 10053 was caused by the TCP RST packet that was pushed to remote server by my client. The time that the RST packet was sent is always right after a packet received that contains 64 bytes I shall read at the end of the loop. But my code is never intended to do that. I'm stuck with this problem for days. Thanks.

    L J 2 Replies Last reply
    0
    • L lynus_zhu

      hi, my code keep encounter the 10053 error when running in windows7 but works fine in winXP. what might be wrong? here is my code http://paste.ubuntu.com/7456583/ and here is the output: http://paste.ubuntu.com/7456610/ the error is always happens in the loop:

      for (j=0;j<10000;j++) {
      sprintf(buf,"%d,%d,%d\n",0,0,0);
      sendall(sock,buf,strlen(buf),__LINE__);
      readall(sock,buf,4,__LINE__);
      n = *(int *)buf;
      assert(n==4);
      /*for (int ii=0;ii<n;ii++) {
      readall(sock,buf,16,__LINE__);
      }*/
      readall(sock,buf,64,__LINE__);
      std::cout<<"j= "<<j<<std::endl;
      Sleep(1000);
      }

      BTW, the server side will not close socket. UPDATE:I used wireshark to notice that the 10053 was caused by the TCP RST packet that was pushed to remote server by my client. The time that the RST packet was sent is always right after a packet received that contains 64 bytes I shall read at the end of the loop. But my code is never intended to do that. I'm stuck with this problem for days. Thanks.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Please do not expect people to download your code and diagnose your problem for you. Show the lines of code where the error occurs (not the entire program) and provide the complete error message associated with the error code.

      L 1 Reply Last reply
      0
      • L Lost User

        Please do not expect people to download your code and diagnose your problem for you. Show the lines of code where the error occurs (not the entire program) and provide the complete error message associated with the error code.

        L Offline
        L Offline
        lynus_zhu
        wrote on last edited by
        #3

        ok,update my message.

        1 Reply Last reply
        0
        • L lynus_zhu

          hi, my code keep encounter the 10053 error when running in windows7 but works fine in winXP. what might be wrong? here is my code http://paste.ubuntu.com/7456583/ and here is the output: http://paste.ubuntu.com/7456610/ the error is always happens in the loop:

          for (j=0;j<10000;j++) {
          sprintf(buf,"%d,%d,%d\n",0,0,0);
          sendall(sock,buf,strlen(buf),__LINE__);
          readall(sock,buf,4,__LINE__);
          n = *(int *)buf;
          assert(n==4);
          /*for (int ii=0;ii<n;ii++) {
          readall(sock,buf,16,__LINE__);
          }*/
          readall(sock,buf,64,__LINE__);
          std::cout<<"j= "<<j<<std::endl;
          Sleep(1000);
          }

          BTW, the server side will not close socket. UPDATE:I used wireshark to notice that the 10053 was caused by the TCP RST packet that was pushed to remote server by my client. The time that the RST packet was sent is always right after a packet received that contains 64 bytes I shall read at the end of the loop. But my code is never intended to do that. I'm stuck with this problem for days. Thanks.

          J Offline
          J Offline
          Jochen Arndt
          wrote on last edited by
          #4

          This error may occur if the connection is blocked by a firewall or anti virus program. Because the error occurs with Windows 7 and not with XP, the probable source is the Windows 7 firewall. Configure your firewall(s) to allow traffic from/to the used protocol and port.

          L 1 Reply Last reply
          0
          • J Jochen Arndt

            This error may occur if the connection is blocked by a firewall or anti virus program. Because the error occurs with Windows 7 and not with XP, the probable source is the Windows 7 firewall. Configure your firewall(s) to allow traffic from/to the used protocol and port.

            L Offline
            L Offline
            lynus_zhu
            wrote on last edited by
            #5

            Jochen Arndt wrote:

            This error may occur if the connection is blocked by a firewall or anti virus program. Because the error occurs with Windows 7 and not with XP, the probable source is the Windows 7 firewall. Configure your firewall(s) to allow traffic from/to the used protocol and port.

            thanks for your reply. I have disable my windows firewall and all my anti-virus program. The problem remains. And I noticed that my machine sends TCP RST packet right after receive 64bytes from remote server. The RST packet which causes the 10053 error is never intended in my code.

            J 1 Reply Last reply
            0
            • L lynus_zhu

              Jochen Arndt wrote:

              This error may occur if the connection is blocked by a firewall or anti virus program. Because the error occurs with Windows 7 and not with XP, the probable source is the Windows 7 firewall. Configure your firewall(s) to allow traffic from/to the used protocol and port.

              thanks for your reply. I have disable my windows firewall and all my anti-virus program. The problem remains. And I noticed that my machine sends TCP RST packet right after receive 64bytes from remote server. The RST packet which causes the 10053 error is never intended in my code.

              J Offline
              J Offline
              Jochen Arndt
              wrote on last edited by
              #6

              The RST can be send by any device/software which is involved in the transmission including routers between client and server. Did you capture the RST at client or server side? You may install client and server on the same machine if possible and connect using the loopback interface. Such connections are usually not filtered by any software like firewalls. If the problem is then still there, it may be Windows 7 TCP stack specific. A useful link that goes into detail about RST packets: http://blogs.technet.com/b/networking/archive/2009/08/12/where-do-resets-come-from-no-the-stork-does-not-bring-them.aspx[^].

              L 1 Reply Last reply
              0
              • J Jochen Arndt

                The RST can be send by any device/software which is involved in the transmission including routers between client and server. Did you capture the RST at client or server side? You may install client and server on the same machine if possible and connect using the loopback interface. Such connections are usually not filtered by any software like firewalls. If the problem is then still there, it may be Windows 7 TCP stack specific. A useful link that goes into detail about RST packets: http://blogs.technet.com/b/networking/archive/2009/08/12/where-do-resets-come-from-no-the-stork-does-not-bring-them.aspx[^].

                L Offline
                L Offline
                lynus_zhu
                wrote on last edited by
                #7

                Jochen Arndt wrote:

                The RST can be send by any device/software which is involved in the transmission including routers between client and server. Did you capture the RST at client or server side?
                 
                You may install client and server on the same machine if possible and connect using the loopback interface. Such connections are usually not filtered by any software like firewalls. If the problem is then still there, it may be Windows 7 TCP stack specific.
                 
                A useful link that goes into detail about RST packets: http://blogs.technet.com/b/networking/archive/2009/08/12/where-do-resets-come-from-no-the-stork-does-not-bring-them.aspx

                Thanks for your replay. I just found out that it is server side's fault. A java coder write the server side code which sends out one byte urgent message via java API function sendUrgentData() at the end of the loop, in order to detect whether the connect is open( this is a really bad method to do the detection). I asked he comment out this statement, than my code work fine!! It turns out it is the win7 network stack that sends out RST packet in response to seeing frequent urgent packet. I guess it is a new self-protection reaction introduced in win7. The same phenomenon is never observed in xp or linux.

                J 1 Reply Last reply
                0
                • L lynus_zhu

                  Jochen Arndt wrote:

                  The RST can be send by any device/software which is involved in the transmission including routers between client and server. Did you capture the RST at client or server side?
                   
                  You may install client and server on the same machine if possible and connect using the loopback interface. Such connections are usually not filtered by any software like firewalls. If the problem is then still there, it may be Windows 7 TCP stack specific.
                   
                  A useful link that goes into detail about RST packets: http://blogs.technet.com/b/networking/archive/2009/08/12/where-do-resets-come-from-no-the-stork-does-not-bring-them.aspx

                  Thanks for your replay. I just found out that it is server side's fault. A java coder write the server side code which sends out one byte urgent message via java API function sendUrgentData() at the end of the loop, in order to detect whether the connect is open( this is a really bad method to do the detection). I asked he comment out this statement, than my code work fine!! It turns out it is the win7 network stack that sends out RST packet in response to seeing frequent urgent packet. I guess it is a new self-protection reaction introduced in win7. The same phenomenon is never observed in xp or linux.

                  J Offline
                  J Offline
                  Jochen Arndt
                  wrote on last edited by
                  #8

                  Fine to here that you resolved the issue and posted the reason. It may be helpful for others.

                  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