Solved

Winsock Control

Posted on 1998-11-26
3
210 Views
Last Modified: 2013-11-13
I need to know if there is another way to wait for a conection when I try to establish a Remote Conection. Right Now I'm Using this Tiny Do While

for Example

winsock1.conect Server(x.x.x.x) Port(NNNN)

Do while .state <> sckconnected
   DoEvents
Loop

I don't like this manner because my CPU reach 100% percent of utilization when the Code Reach the Do while.

Any help will be apreciated
ATT Joel
0
Comment
Question by:jcancel
  • 2
3 Comments
 

Accepted Solution

by:
ljaques earned 200 total points
ID: 1447056
When using the Winsock control there is a special event that occurs called : "Connect" that gets triggered when a connection has been established. So either select this event from the drop down box of the methods box (for the winsock control) or make a new procedure named: Private sub Winsock1_Connect()

Of course, by using this procedure it does not give you the ability to display the other states that the socket may be in just before connecting ie. "Resolving Host", "Wait For Response", etc.. To do this you would have to make a small while loop and continuously check the winsock1.state function.
0
 

Author Comment

by:jcancel
ID: 1447057
Adjusted points to 200
0
 

Author Comment

by:jcancel
ID: 1447058
ThanK you very Much
att Joel Cancel
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

This article will show, step by step, how to integrate R code into a R Sweave document
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

813 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

17 Experts available now in Live!

Get 1:1 Help Now