Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trouble with WinSock, what´s happening here?
Message
From
25/04/2005 10:03:04
 
 
To
21/04/2005 08:00:09
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 8
OS:
Windows NT
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01006357
Message ID:
01008070
Views:
39
Yeah, thanks for the info, but I'm afraid that you didn't get what I'm saying.

Here´s the code for analysis.
thisform.tcpClient.object.Close()
thisform.tcpClient.object.Connect()
llShutdown = .F.
** SET STEP ON 
= INKEY(0.2,"H")
IF thisform.tcpClient.object.State = 7 &&Connected
	thisform.sentCommand="PING"
	thisform.lblStatus.Caption="Status: Sending command to server..."
	thisform.tcpClient.object.SendData(thisform.sentCommand+CHR(13)+CHR(10))	
	= INKEY(0.5,"H")		
	thisform.lblStatus.Caption = ALLTRIM(UPPER(thisform.serverMessage))	
	IF ALLTRIM(UPPER(thisform.serverMessage)) = "OK!"
		i = 0
		llStop = .F.
		DO WHILE i < 60 AND NOT llStop
			thisform.tcpClient.Object.Close()
			thisform.tcpClient.object.Connect()
			= INKEY(0.5,"H")
			IF thisform.tcpClient.object.State = 7 &&Connected
				thisform.sentCommand = "PING"
				thisform.tcpClient.object.SendData(thisform.sentCommand+CHR(13)+CHR(10))					
				= INKEY(0.8,"H")
				IF ALLTRIM(UPPER(thisform.serverMessage)) = "OK!"
					i = i + 1 
				ELSE
					IF NOT llDesligando
						thisform.lblStatus.Caption = "Status: The server is being shutdown..."
						= INKEY(15,"H")
						i = i + 1 
						llShutdown = .T.
					ELSE 
						thisform.lblStatus.Caption = "Status: Server successfully shutdown"
						llStop = .T.
					ENDIF 
				ENDIF
			ENDIF 
		ENDDO
		IF NOT llStop
			thisform.lblStatus.Caption = "Status: Timeout occurred while sending command"
		ENDIF 
	ELSE 
		thisform.lblStatus.Caption = "Status: Server offline"
	ENDIF 	
ENDIF 
WAIT CLEAR 
Well, notice the commented SET STEP ON there? when I run the code ignoring that line, server never returns anything. Whenever I uncomment the SET STEP ON line, server does return the OK! to the serverMessage property.

Here's the code for tcpClient.dataArrival:
*** ActiveX Control Event ***
LPARAMETERS bytestotal
lcServerMessage = SPACE(bytesTotal)
thisform.tcpClient.object.GetData(@lcServerMessage)
thisform.serverMessage = lcServerMessage
What is the problem here, then?

TIA again!
Pablo Márcio de Oliveira

Inside the scream is silent, inside it must remain
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform