<?php $cfgServer = "10.100.4.98"; $cfgPort = 8085; $cfgTimeOut = 300; $txt = "Hello World"; $errno = 0; $errstr = 0; // open a socket if(!$cfgTimeOut) // without timeout $usenet_handle = fsockopen($cfgServer, $cfgPort); else // with timeout $usenet_handle = fsockopen($cfgServer, $cfgPort, &$errno, &$errstr, $cfgTimeOut); if(!$usenet_handle) { echo "Connexion failed\n"; exit(); } else { echo "Connected\n"; $tmp = fgets($usenet_handle, 1024); //fputs($usenet_handle, "$txt"); fclose ($usenet_handle); } ?>
OnRun() IF ISCLEAR(CC2) THEN CREATE(CC2); IF ISCLEAR(SBA) THEN CREATE(SBA); CC2.AddBusAdapter(SBA, 0); //Timeout setzten SBA.ReceivingTimeout:= 20000; SBA.OpenSocket(8085, ''); CC2::MessageReceived(VAR InMessage : Automation "''.IDISPATCH") //Nachricht abnehmen InMsg:= InMessage; //In einen InStream schreiben InS:= InMsg.GetStream(); //Antwortnachricht erzeugen OutMsg:= InMsg.CreateReply; //In einen OutStream schreiben OutS:= OutMsg.GetStream(); //Eingegangene Nachricht in die Ausgangsnachricht kopieren COPYSTREAM(OutS,InS); //Anwortnachricht versenden OutMsg.Send(0); InMsg.CommitMessage();
Comments
Your script can also be terminated by the built-in script timer. The default timeout is 30 seconds. It can be changed using the max_execution_time php.ini directive or the corresponding "php_value max_execution_time" Apache .conf directive as well as with the set_time_limit() function. When the timer expires the script will be aborted
Greetings
sabato