By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,156 Members | 1,022 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,156 IT Pros & Developers. It's quick & easy.

Winsock Control (listen) hangs in IDE ?

P: n/a
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).State <> sckClosed Then Winsock1(0).Close
If Command1.Caption = "Host" Then
Command1.Caption = "Stop Host"
Winsock1(0).LocalPort = 6570
Winsock1(0).Listen
Else
Command1.Caption = "Host"
End If
End Sub

Private Sub Form_Load()
Command1.Caption = "Host"
End Sub

Jul 17 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Oh ya. I'm using VB 6.0
:c)
"C. Alexander" <ca********@nospam.yahoo.com> wrote in message
news:xA*******************@fe3.columbus.rr.com...
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).State <> sckClosed Then Winsock1(0).Close
If Command1.Caption = "Host" Then
Command1.Caption = "Stop Host"
Winsock1(0).LocalPort = 6570
Winsock1(0).Listen
Else
Command1.Caption = "Host"
End If
End Sub

Private Sub Form_Load()
Command1.Caption = "Host"
End Sub

Jul 17 '05 #2

P: n/a
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" <ca********@nospam.yahoo.com> wrote in message
news:xA*******************@fe3.columbus.rr.com...
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).State <> sckClosed Then Winsock1(0).Close
If Command1.Caption = "Host" Then
Command1.Caption = "Stop Host"
Winsock1(0).LocalPort = 6570
Winsock1(0).Listen
Else
Command1.Caption = "Host"
End If
End Sub

Private Sub Form_Load()
Command1.Caption = "Host"
End Sub

Jul 17 '05 #3

P: n/a
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
un*****@hotmail.nospam.com
Jul 17 '05 #4

P: n/a
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" <un*****@hotmail.nospam.com> wrote in message
news:R3****************@bignews4.bellsouth.net...
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
un*****@hotmail.nospam.com

Jul 17 '05 #5

P: n/a
"C. Alexander" <ca********@nospam.yahoo.com> wrote in message
news:7f********************@fe3.columbus.rr.com...
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*
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. un*****@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
un*****@cfl.rr.com (remember, put VB Project Code as the subject line)

"Trousle Undrhil" <un*****@hotmail.nospam.com> wrote in message
news:R3****************@bignews4.bellsouth.net...
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
un*****@hotmail.nospam.com


Jul 17 '05 #6

P: n/a
> 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. un*****@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
un*****@cfl.rr.com (remember, put VB Project Code as the subject line)


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....
Jul 17 '05 #7

P: n/a
"C. Alexander" <ca********@nospam.yahoo.com> wrote in message
news:DV********************@fe3.columbus.rr.com...
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. un*****@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
un*****@cfl.rr.com (remember, put VB Project Code as the subject line)


Yes the winsock component had the SP5 appended.

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


OK, I got the file. I have loaded it into VB6.
*Load project
*Hit F5 to run program
*Click "Host" many times
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'?
*Click "Exit"
*Hit F5 to run program
*Click "Host" once
*It freezed at this point

Hope this helps....


Ken
Jul 17 '05 #8

P: n/a
> OK, I got the file. I have loaded it into VB6.
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?
as many times as you want. once, twice, thirty, it doesn't matter.
Also, does it hang the program itself once compiled? Finally, is there any functionality reason for clicking the host button 'many times'?


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...

Jul 17 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.