[resolved, kind of] VB stop responding when winsock tries to connect
Here is how it goes: I've got a simple chat app that uses MS Winsock control for TCP communication. The first time I run the app from VB its all OK. But, when I exit the app (normally, not break), return to VB, run it again, it crashes (app & VB stop responding and need to be killed) when Connect button is clicked. When runing it as an exe when its built everything is OK. :ehh: :afrog:
Any ideas why this is happening? :sick:
Re: VB stop responding when winsock tries to connect.
Quote:
Originally Posted by ns-code
Here is how it goes: I've got a simple chat app that uses MS Winsock control for TCP communication. The first time I run the app from VB its all OK. But, when I exit the app (normally, not break), return to VB, run it again, it crashes (app & VB stop responding and need to be killed) when Connect button is clicked. When runing it as an exe when its built everything is OK. :ehh: :afrog:
Any ideas why this is happening? :sick:
Are you running some checking routine in a loop without any DoEvents statement. That might be the culprit. Run the code line by line (F8) and see where it starts causing problems.
Pradeep :)
Re: VB stop responding when winsock tries to connect.
It fails on Winsock.Connect. It also fails on server side (different program), so my code is definitly not the problem. :p
Btw, it's VB6 with SP5, Win XP SP1. I've got another dual boot Windows XP SP1, and it also fails there. :(
Re: VB stop responding when winsock tries to connect
Hey Ns-Code,
Quote:
so my code is definitly not the problem
The Number of times I have said this :eek:
Ok i've moved you post to the network forum, Now then could you post you application for me to have a look at? I should be able to find the problem.
Pino
Re: VB stop responding when winsock tries to connect
Ok, i've put it in a general forum thinking that it's actually a VB problem.. Anyway, here are the source files. User interface and most comments and object names are in Serbian, but I hope you'll find your way around
:wave:
Re: VB stop responding when winsock tries to connect
One other thing. I just downloaded your winsock chat example, just to see... and gues what - it crashes too! So, it's DEFINITLY not MY code problem :p :lol:
Oh, and if you see any stupidity in my code, please excuse it... this is a come back projet for me, haven't done anything in VB for over a year and it was done in three days :bigyello:
Re: VB stop responding when winsock tries to connect
Does VB have access thru the firewall?
Re: VB stop responding when winsock tries to connect
Sygate was running, but in Allow all mode. I tried restarting without it to no avail.
Re: VB stop responding when winsock tries to connect
It doesnt crash here,
Tell me exactly how to make it crash?
Firewall shouldnt be an issue,
Set Ip To 127.0.0.1
Let Me Know
Re: VB stop responding when winsock tries to connect
Run it. Click connect. Regardles if it succesfully connects to the server or not, stop it to return to VB. F5 it again and click connect.
Re: VB stop responding when winsock tries to connect
No problems here at all,
2.6ghz P4 with 512 Ram,
Try adding some doevent sinto you connection request loop.
VB Code:
For i = 1 To Winsock.Count + 1
Fnd = False
For x = 1 To lsvUsers.ListItems.Count
If lsvUsers.ListItems(x).Text = i Then Fnd = True
Next x
If Not Fnd Then
Exit For
End If
Next i
But theres no problems here it connects 1st second and third time
Re: VB stop responding when winsock tries to connect
Ok, thanks for the help. It's not that big of a problem anyway as it appears only during development.. just anoying :D and the project is nearly finished anyway :cool: