Solved

Some Problem with Winsock.....

Posted on 2006-11-20
16
320 Views
Last Modified: 2013-11-13
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
Comment
Question by:imarshad
  • 8
  • 3
  • 2
  • +2
16 Comments
 
LVL 10

Expert Comment

by:Kinger247
Comment Utility
are you closing the socket like :

Private Sub Form_Unload(Cancel As Integer)
 Winsock1.Close
End Sub
0
 
LVL 13

Author Comment

by:imarshad
Comment Utility
No I am not but I have tried it.... It makes no difference.....
0
 
LVL 13

Author Comment

by:imarshad
Comment Utility
Just to add I have VB6 with SP6....
0
 
LVL 10

Expert Comment

by:Kinger247
Comment Utility
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
 
LVL 13

Author Comment

by:imarshad
Comment Utility
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
 
LVL 10

Expert Comment

by:Kinger247
Comment Utility
just to make sure its not a port issues .. does it work using a different port ?
0
 
LVL 13

Author Comment

by:imarshad
Comment Utility
also all other Socket related things like IE, Torrents, Wireless connection, Internet etc. are working fine.....
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 13

Author Comment

by:imarshad
Comment Utility
>>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
 
LVL 12

Expert Comment

by:jkaios
Comment Utility
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
 
LVL 13

Author Comment

by:imarshad
Comment Utility
>>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
 
LVL 13

Author Comment

by:imarshad
Comment Utility
http://www.codeguru.com/forum/showthread.php?t=281289 is an exact replica of my problem....
0
 
LVL 4

Expert Comment

by:seshu123
Comment Utility
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
 
LVL 12

Expert Comment

by:jkaios
Comment Utility
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
 
LVL 3

Accepted Solution

by:
Stimphy earned 250 total points
Comment Utility
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
 
LVL 13

Author Comment

by:imarshad
Comment Utility
Oops I forgot that I had this one open..... I will finalize this within 2 days...
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
changeXy challenge 13 56
firstChar challenge 13 83
Microsoft Access combo box help 2 28
MS Date Picker 64 bit 32 bit issue 12 42
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now