Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WinSock - How to connect
Message
From
02/11/2005 10:24:42
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
WinSock - How to connect
Environment versions
Visual FoxPro:
VFP 6 SP5
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01064476
Message ID:
01064476
Views:
51
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!
Next
Reply
Map
View

Click here to load this message in the networking platform