Solved

Winsock Control

Posted on 1998-11-26
3
213 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
[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
  • 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
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…

732 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