[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 336
  • Last Modified:

Some Problem with Winsock.....

Hi all !
        I have been developing with Winsock for quite a while. Now I am facing a very strange problem. When ever I add Winsock control to any project of mine the project runs OK but I can't stop the program without VB being crashed. For example I added a winsock control named Winsock1 (with default settings) to my form and added the following code. With no code what so ever on the form (No other controls or anything) I cant close my program while clicking on the "Cross button" or even adding an "End" statement in a button to close and each time VB crashes.

Private Sub Form_Load()
        Winsock1.LocalPort = 7070
        Winsock1.Listen

End Sub

I know there might be something wrong with my Winsock but how to correct it?
0
imarshad
Asked:
imarshad
  • 8
  • 3
  • 2
  • +2
1 Solution
 
Kinger247Commented:
are you closing the socket like :

Private Sub Form_Unload(Cancel As Integer)
 Winsock1.Close
End Sub
0
 
imarshadAuthor Commented:
No I am not but I have tried it.... It makes no difference.....
0
 
imarshadAuthor Commented:
Just to add I have VB6 with SP6....
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Kinger247Commented:
I've had a similar problem before and fixed it using an application built to fix winsock issues.
But it was a while ago and can't find the setup application anymore.
0
 
imarshadAuthor Commented:
and the problem line is Winsock1.Listen . If I comment it all my projects work fine...... Except of course the winsock part. These used to work fine earlier....
I have Windows XP SP2 installed....
0
 
Kinger247Commented:
just to make sure its not a port issues .. does it work using a different port ?
0
 
imarshadAuthor Commented:
also all other Socket related things like IE, Torrents, Wireless connection, Internet etc. are working fine.....
0
 
imarshadAuthor Commented:
>>just to make sure its not a port issues .. does it work using a different port ?
No it is not working on any port.....
0
 
jkaiosIT DirectorCommented:
Is your XP SP2 Firewall turned on?  If so, try turning it off and see if that problem goes away.

One more thing: What protocol are you using - TCP or UDP?
0
 
imarshadAuthor Commented:
>>One more thing: What protocol are you using - TCP or UDP?
TCP.....

>>Is your XP SP2 Firewall turned on?  If so, try turning it off and see if that problem goes away.
No it is not on......
0
 
imarshadAuthor Commented:
http://www.codeguru.com/forum/showthread.php?t=281289 is an exact replica of my problem....
0
 
seshu123Commented:
Hai,
   This is purely your operating system problem.  because your firewall is going to restrict the connection.  so pls. turnoff the windows firewall system and then try this.  it will work fine.


Seshu123
0
 
jkaiosIT DirectorCommented:
If your XP Firewall is OFF and still you're having the same problem, then check to see if you have other firewall installed, such as BlackIce, Zone Alarm, Norton, etc.
0
 
StimphyCommented:
I have had similar issues in the past.
I found this nifty little program that cures alot of Winsock/networking issues.

http://www.snapfiles.com/get/winsockxpfix.html
0
 
imarshadAuthor Commented:
Oops I forgot that I had this one open..... I will finalize this within 2 days...
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 8
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now