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
Solved

Winsock Control

Posted on 1998-11-26
3
211 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
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 tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

860 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