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 CLEARWell, 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.
*** ActiveX Control Event *** LPARAMETERS bytestotal lcServerMessage = SPACE(bytesTotal) thisform.tcpClient.object.GetData(@lcServerMessage) thisform.serverMessage = lcServerMessageWhat is the problem here, then?