Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WinSock - How to connect
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 6 SP5
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01064476
Message ID:
01064851
Views:
31
This message has been marked as the solution to the initial question of the thread.
Did you also try .OBJECT.CONNECT(allt(Tbl_DeviceList.ip), "23" ) ?
Jaime

>Hello everybody.
>
>i got a question concerning the WinSock activeX.
>
>i am trying to connect to a router through winsock, and for some reason the .state stays at 0. am i doing something obvously wrong? here is my sample code (simplyfied):
>* put an instance of the WinSock (located on an invisible form) in a array
>THIS.a_WinSocks(m.nNextRow, 2) = NEWOBJECT("WinSock", THIS.CLASSLIBRARY)
>
>* ***
>SELE 0
>USE devicelist ALIAS Tbl_DeviceList AGAIN

>SET ORDER TO ID
>SEEK m.nWinSockId
>
>WITH THIS.a_WinSocks(m.nNextRow, 2).oWinSock
>
>	* *** telnet port = 23
>	* *** IP is in format ###.###.###.###
>	.CONNECT(ALLT(Tbl_DeviceList.ip), "23")
>
>	USE IN Tbl_DeviceList
>
>	nTime = SECONDS()
>	DO WHILE .state = 0 .AND. m.nTime + This.nTimeOut >= SECONDS()
>		WAIT WIND TRANS(.state) NOWAIT
>		DOEVENTS
>	ENDDO
>
>	MESSAGEBOX(TRANS(.state))
>endwith
>
>i thought it was simple enough, but i guess i was wrong {s}.
>any ideas?
>
>thanks for all your help!
Why do programs stop working correctly as soon as you leave the Fox?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform