Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
INKEY and SLEEP
Message
From
19/02/2008 13:15:12
 
 
To
19/02/2008 12:13:50
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01293829
Message ID:
01293882
Views:
16
>I am working with a winsock. These two commands actually connect it to the remote IP:
>RemoteHost = "someIP"
>Connect()
>If I check State right after Connect() it is 6: Connecting. But what I want is 7: Connected. If I put SLEEP after Connect it does not help. The State is always 6 regardless how long the SLEEP waits, but if I use INKEY then even delaying for 0.1 helps to get State to 7. Any idea?
>
>Thanks

With sleep, VFP sleep!

With INKEY VFP don't sleep...

try
FOR K=100 TO 1 STEP -1
  Sleep(10)
  DOEVENTS
  IF winsockState=7
    EXIT
  END
NEXT
IF empty(m.k)
  * timeout
ELSE
 * connected
ENDIF
Previous
Reply
Map
View

Click here to load this message in the networking platform