473,327 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

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).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
8 6174
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
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
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
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
"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
> 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
"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
> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: N.Naeem | last post by:
Hello all i need a solution to the following problem I have an application which listens to a port for incoming connections from a client via a Winsock. let's call this Winsock1 Upon a...
0
by: Ted | last post by:
I'm writing an app that returns a client's IP when they click a link to my IP in AIM. I have the app listening on port 80, and then after they click the link I press a command button that puts a...
3
by: Bill | last post by:
When vb6 Winsock.RemoteHost is set to "127.0.0.1", c# socket listener cannot hear connect request (my old vb6 winsock listener could hear it...). Why doesn't this work, and is there a work...
5
by: Daniel | last post by:
Hi group, In VB6 if I wanted my app to listen on a specific IP port I used the Winsock control along with the great example code on MSDN. Now, for .NET I assume that there is a class for this....
5
by: kc | last post by:
Hi Just upgrading a app from VB6 to VB.Net. All is going well apart from the Winsock control. The first thing we notice is that there does not appear to be a .Net version (please correct me if...
1
by: Nicolas Ghesquiere | last post by:
Hello I have a problem with my current program. The meaning of the program is to allow users to login to a server to allow them to access the internet. My program communicates with a MS isa...
1
by: kpaxoid | last post by:
An odd problem. Application runs fine in the VB6 IDE, but when compiled, as soon as the application attempts to execute Winsock.Listen 'Winsock is created by Winsock = New Winsock the...
1
by: ninjawolfen | last post by:
Hi, I'm doing an application in VB 6 SP6 in XP Prof. SP2, this app used to work fine, until i used a ms-winsock control to connect to a fingerprint terminal reader, in the IDE everithing that the app...
3
AaronL
by: AaronL | last post by:
Hello, I am currently working on a project that has me in sort of a bind. What I want to do is retrieve web pages from the internet, and strip them down to just text. I'll get using Regular...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.