Winsock Control (listen) hangs in IDE ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • C. Alexander

    Winsock Control (listen) hangs in IDE ?

    Im running a small server that seems to work fine outside the IDE as an exe,
    but within the IDE, when I run the program for the first time, i can
    start/stop
    the host many times. But I end the program within the IDE, and start it back
    up,
    when I click on the Host button, the entire IDE hangs.

    I created a quick test program to try and figure out where the problem was..

    Basically i created a form and put a command button, and a mswinsock
    control on the form. The subs below is what I was using.
    Run this the first time, and I can Host/Stop Host several times.
    But if I stop running this in the IDE, and restart it in the IDE, once I
    click on the
    command1 (Host) button, the entire IDE hangs once it gets to Winsock1.Listen

    I've tried changing it so that Winsock1 does not have an index, and it
    doesn't help either.

    I've tried reinstalling the mswinsck.ocx and reregistering it, but it didn't
    help.

    Any Ideas?

    Private Sub Command1_Click( )
    If Winsock1(0).Sta te <> sckClosed Then Winsock1(0).Clo se
    If Command1.Captio n = "Host" Then
    Command1.Captio n = "Stop Host"
    Winsock1(0).Loc alPort = 6570
    Winsock1(0).Lis ten
    Else
    Command1.Captio n = "Host"
    End If
    End Sub

    Private Sub Form_Load()
    Command1.Captio n = "Host"
    End Sub



  • C. Alexander

    #2
    Re: Winsock Control (listen) hangs in IDE ?

    Oh ya. I'm using VB 6.0
    :c)


    "C. Alexander" <calexander@nos pam.yahoo.com> wrote in message
    news:xATSb.9824 1$f97.90051@fe3 .columbus.rr.co m...[color=blue]
    > Im running a small server that seems to work fine outside the IDE as an[/color]
    exe,[color=blue]
    > but within the IDE, when I run the program for the first time, i can
    > start/stop
    > the host many times. But I end the program within the IDE, and start it[/color]
    back[color=blue]
    > up,
    > when I click on the Host button, the entire IDE hangs.
    >
    > I created a quick test program to try and figure out where the problem[/color]
    was..[color=blue]
    >
    > Basically i created a form and put a command button, and a mswinsock
    > control on the form. The subs below is what I was using.
    > Run this the first time, and I can Host/Stop Host several times.
    > But if I stop running this in the IDE, and restart it in the IDE, once I
    > click on the
    > command1 (Host) button, the entire IDE hangs once it gets to[/color]
    Winsock1.Listen[color=blue]
    >
    > I've tried changing it so that Winsock1 does not have an index, and it
    > doesn't help either.
    >
    > I've tried reinstalling the mswinsck.ocx and reregistering it, but it[/color]
    didn't[color=blue]
    > help.
    >
    > Any Ideas?
    >
    > Private Sub Command1_Click( )
    > If Winsock1(0).Sta te <> sckClosed Then Winsock1(0).Clo se
    > If Command1.Captio n = "Host" Then
    > Command1.Captio n = "Stop Host"
    > Winsock1(0).Loc alPort = 6570
    > Winsock1(0).Lis ten
    > Else
    > Command1.Captio n = "Host"
    > End If
    > End Sub
    >
    > Private Sub Form_Load()
    > Command1.Captio n = "Host"
    > End Sub
    >
    >
    >[/color]


    Comment

    • C. Alexander

      #3
      Re: Winsock Control (listen) hangs in IDE ?

      I just tried using the Catalyst SocketWrench Control 3.6,
      but it hangs exactly the same way.

      So this must be the IDE that is having the problem?

      I have completly uninstalled/reinstalled Visual Studios 6
      making sure the folder was removed as well.

      This did not seem to help.

      Im lost :c(



      "C. Alexander" <calexander@nos pam.yahoo.com> wrote in message
      news:xATSb.9824 1$f97.90051@fe3 .columbus.rr.co m...[color=blue]
      > Im running a small server that seems to work fine outside the IDE as an[/color]
      exe,[color=blue]
      > but within the IDE, when I run the program for the first time, i can
      > start/stop
      > the host many times. But I end the program within the IDE, and start it[/color]
      back[color=blue]
      > up,
      > when I click on the Host button, the entire IDE hangs.
      >
      > I created a quick test program to try and figure out where the problem[/color]
      was..[color=blue]
      >
      > Basically i created a form and put a command button, and a mswinsock
      > control on the form. The subs below is what I was using.
      > Run this the first time, and I can Host/Stop Host several times.
      > But if I stop running this in the IDE, and restart it in the IDE, once I
      > click on the
      > command1 (Host) button, the entire IDE hangs once it gets to[/color]
      Winsock1.Listen[color=blue]
      >
      > I've tried changing it so that Winsock1 does not have an index, and it
      > doesn't help either.
      >
      > I've tried reinstalling the mswinsck.ocx and reregistering it, but it[/color]
      didn't[color=blue]
      > help.
      >
      > Any Ideas?
      >
      > Private Sub Command1_Click( )
      > If Winsock1(0).Sta te <> sckClosed Then Winsock1(0).Clo se
      > If Command1.Captio n = "Host" Then
      > Command1.Captio n = "Stop Host"
      > Winsock1(0).Loc alPort = 6570
      > Winsock1(0).Lis ten
      > Else
      > Command1.Captio n = "Host"
      > End If
      > End Sub
      >
      > Private Sub Form_Load()
      > Command1.Captio n = "Host"
      > End Sub
      >
      >
      >[/color]


      Comment

      • Trousle Undrhil

        #4
        Re: Winsock Control (listen) hangs in IDE ?

        Are you running this in Windows 98? Windows XP? I saw the reply where you
        said you are running VB 6. Are you running with the lastest Service Pack
        for VB6? I am running with Windows XP, VB 6 with the latest service pack
        and I can run this code just fine with no problems. When I select the
        Winsock control in VB6, the actual title in the Components window is
        Microsoft Winsock Control 6.0 (SP5). Is yours different? If so, I'd
        suggest getting the latest service pack for Visual Studio and installing it
        and see if that helps any.

        Ken
        undrhil@hotmail .nospam.com


        Comment

        • C. Alexander

          #5
          Re: Winsock Control (listen) hangs in IDE ?

          Yes, I was a little ignorant i not including this information.

          I run WindowsXP, with VS6.0 SP5 installed.
          I have tried running it with and without sp5 during reinstallations but to
          no avail.

          I found out that this problem is not bound to the "Listen" method, but to
          the "Connect" method as well. I also tested this problem using UDP, and i
          get the same problem.

          On a side note, when i changed it to UDP, it worked without problems as many
          times as I needed it to, until i restarted the IDE, and tried it again. At
          this point it froze as before. I had the same thing happen during variations
          of the TCP server as well as client. If i try to flip/flop the protocol
          around, it doesn't always work. Its completly random.

          I did test out a VB program that did not use any components, but instead a
          class/module winsock interface. This did not seem to hang the IDE.

          So is my VB having a problem with network components?

          *still lost*


          "Trousle Undrhil" <undrhil@hotmai l.nospam.com> wrote in message
          news:R3hTb.9088 $7I3.972@bignew s4.bellsouth.ne t...[color=blue]
          > Are you running this in Windows 98? Windows XP? I saw the reply where[/color]
          you[color=blue]
          > said you are running VB 6. Are you running with the lastest Service Pack
          > for VB6? I am running with Windows XP, VB 6 with the latest service pack
          > and I can run this code just fine with no problems. When I select the
          > Winsock control in VB6, the actual title in the Components window is
          > Microsoft Winsock Control 6.0 (SP5). Is yours different? If so, I'd
          > suggest getting the latest service pack for Visual Studio and installing[/color]
          it[color=blue]
          > and see if that helps any.
          >
          > Ken
          > undrhil@hotmail .nospam.com
          >
          >[/color]


          Comment

          • Trousle Undrhil

            #6
            Re: Winsock Control (listen) hangs in IDE ?

            "C. Alexander" <calexander@nos pam.yahoo.com> wrote in message
            news:7foTb.1099 74$f97.62806@fe 3.columbus.rr.c om...[color=blue]
            > Yes, I was a little ignorant i not including this information.
            >
            > I run WindowsXP, with VS6.0 SP5 installed.
            > I have tried running it with and without sp5 during reinstallations but to
            > no avail.
            >
            > I found out that this problem is not bound to the "Listen" method, but to
            > the "Connect" method as well. I also tested this problem using UDP, and i
            > get the same problem.
            >
            > On a side note, when i changed it to UDP, it worked without problems as[/color]
            many[color=blue]
            > times as I needed it to, until i restarted the IDE, and tried it again. At
            > this point it froze as before. I had the same thing happen during[/color]
            variations[color=blue]
            > of the TCP server as well as client. If i try to flip/flop the protocol
            > around, it doesn't always work. Its completly random.
            >
            > I did test out a VB program that did not use any components, but instead a
            > class/module winsock interface. This did not seem to hang the IDE.
            >
            > So is my VB having a problem with network components?
            >
            > *still lost*[/color]

            So, can you email me the code you are using. The complete code this time?
            Just save out the project in it's entirety and zip it up with WinZip or
            WinRar or something and slap it to me. undrhil@cfl.rr. com ... just put VB
            Project Code as the subject so I don't automatically delete it, ok? Also,
            you didn't tell me if the control you are using has the (SP5) tag at the end
            of its name in the Components dialog.

            Thanks,
            Ken
            undrhil@cfl.rr. com (remember, put VB Project Code as the subject line)
            [color=blue]
            >
            > "Trousle Undrhil" <undrhil@hotmai l.nospam.com> wrote in message
            > news:R3hTb.9088 $7I3.972@bignew s4.bellsouth.ne t...[color=green]
            > > Are you running this in Windows 98? Windows XP? I saw the reply where[/color]
            > you[color=green]
            > > said you are running VB 6. Are you running with the lastest Service[/color][/color]
            Pack[color=blue][color=green]
            > > for VB6? I am running with Windows XP, VB 6 with the latest service[/color][/color]
            pack[color=blue][color=green]
            > > and I can run this code just fine with no problems. When I select the
            > > Winsock control in VB6, the actual title in the Components window is
            > > Microsoft Winsock Control 6.0 (SP5). Is yours different? If so, I'd
            > > suggest getting the latest service pack for Visual Studio and installing[/color]
            > it[color=green]
            > > and see if that helps any.
            > >
            > > Ken
            > > undrhil@hotmail .nospam.com
            > >
            > >[/color]
            >
            >[/color]


            Comment

            • C. Alexander

              #7
              Re: Winsock Control (listen) hangs in IDE ?

              > So, can you email me the code you are using. The complete code this time?[color=blue]
              > Just save out the project in it's entirety and zip it up with WinZip or
              > WinRar or something and slap it to me. undrhil@cfl.rr. com ... just put VB
              > Project Code as the subject so I don't automatically delete it, ok? Also,
              > you didn't tell me if the control you are using has the (SP5) tag at the[/color]
              end[color=blue]
              > of its name in the Components dialog.
              >
              > Thanks,
              > Ken
              > undrhil@cfl.rr. com (remember, put VB Project Code as the subject line)[/color]

              Yes the winsock component had the SP5 appended.

              I sent you the vbp and frm file.
              Steps to recreate my error:

              *Load project
              *Hit F5 to run program
              *Click "Host" many times
              *Click "Exit"
              *Hit F5 to run program
              *Click "Host" once
              *It freezed at this point

              Hope this helps....


              Comment

              • Trousle Undrhil

                #8
                Re: Winsock Control (listen) hangs in IDE ?

                "C. Alexander" <calexander@nos pam.yahoo.com> wrote in message
                news:DVGTb.1271 75$f97.46340@fe 3.columbus.rr.c om...[color=blue][color=green]
                > > So, can you email me the code you are using. The complete code this[/color][/color]
                time?[color=blue][color=green]
                > > Just save out the project in it's entirety and zip it up with WinZip or
                > > WinRar or something and slap it to me. undrhil@cfl.rr. com ... just put[/color][/color]
                VB[color=blue][color=green]
                > > Project Code as the subject so I don't automatically delete it, ok?[/color][/color]
                Also,[color=blue][color=green]
                > > you didn't tell me if the control you are using has the (SP5) tag at the[/color]
                > end[color=green]
                > > of its name in the Components dialog.
                > >
                > > Thanks,
                > > Ken
                > > undrhil@cfl.rr. com (remember, put VB Project Code as the subject line)[/color]
                >
                > Yes the winsock component had the SP5 appended.
                >
                > I sent you the vbp and frm file.
                > Steps to recreate my error:[/color]

                OK, I got the file. I have loaded it into VB6.
                [color=blue]
                > *Load project
                > *Hit F5 to run program
                > *Click "Host" many times[/color]

                By 'many times' how many times are you meaning? Have you tried just
                clicking your Host button twice and exiting and seeing if the IDE hangs?
                Also, does it hang the program itself once compiled? Finally, is there any
                functionality reason for clicking the host button 'many times'?
                [color=blue]
                > *Click "Exit"
                > *Hit F5 to run program
                > *Click "Host" once
                > *It freezed at this point
                >
                > Hope this helps....
                >[/color]

                Ken


                Comment

                • C. Alexander

                  #9
                  Re: Winsock Control (listen) hangs in IDE ?

                  > OK, I got the file. I have loaded it into VB6.[color=blue]
                  > By 'many times' how many times are you meaning? Have you tried just
                  > clicking your Host button twice and exiting and seeing if the IDE hangs?[/color]

                  as many times as you want. once, twice, thirty, it doesn't matter.
                  [color=blue]
                  > Also, does it hang the program itself once compiled? Finally, is there[/color]
                  any[color=blue]
                  > functionality reason for clicking the host button 'many times'?[/color]

                  The compiled program itself does not hang at all, it works just fine.
                  The IDE is what hangs after the second time i run the program within the
                  IDE.
                  And as far as functionality reason for clicking the host button, other than
                  just start/stop the winsock service, there's no reason for 'many times'.
                  Just reassurance the the program is responding...





                  Comment

                  Working...