Solved

Some Problem with Winsock.....

Posted on 2006-11-20
16
327 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 3
  • 2
  • +2
16 Comments
 
LVL 10

Expert Comment

by:Kinger247
ID: 17978393
are you closing the socket like :

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

Author Comment

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

Author Comment

by:imarshad
ID: 17978409
Just to add I have VB6 with SP6....
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 10

Expert Comment

by:Kinger247
ID: 17978434
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
ID: 17978454
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
ID: 17978462
just to make sure its not a port issues .. does it work using a different port ?
0
 
LVL 13

Author Comment

by:imarshad
ID: 17978481
also all other Socket related things like IE, Torrents, Wireless connection, Internet etc. are working fine.....
0
 
LVL 13

Author Comment

by:imarshad
ID: 17978487
>>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
ID: 17984113
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
ID: 17985081
>>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
ID: 17985183
http://www.codeguru.com/forum/showthread.php?t=281289 is an exact replica of my problem....
0
 
LVL 4

Expert Comment

by:seshu123
ID: 18026969
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
ID: 18031244
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
ID: 18058978
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
ID: 18372346
Oops I forgot that I had this one open..... I will finalize this within 2 days...
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Best way to parse out a json string in VB6? 10 395
MS Access 03, TransferText, decimal places 8 92
JVM error from eclipse 1 27
2 Global Vars, 1 List Box 4 33
If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

738 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