#: \file theLink/example/php/mulserver.php #: \brief \$Id$ #: #: (C) 2010 - NHI - #1 - Project - Group #: #: \version \$Rev$ #: \author EMail: aotto1968 at users.berlios.de #: \attention this software has GPL permissions to copy #: please contact AUTHORS for additional information #: class MulServer extends MqS implements iServerSetup { public function ServerSetup() { $this->ServiceCreate('MMUL', array(&$this, 'MMUL')); } public function MMUL() { $this->SendSTART(); $this->SendD($this->ReadD() * $this->ReadD()); $this->SendRETURN(); } } $srv = FactoryAdd('mulserver', 'MulServer')->New(); try { $srv->LinkCreate($argv); $srv->ProcessEvent(MqS::WAIT_FOREVER); } catch (Exception $ex) { $srv->ErrorSet($ex); } $srv->Exit();
$ftr = $this->ServiceGetFilter(); $ftr->SendSTART(); $ftr->SendC('F3'); $ftr->SendC($ftr->ConfigGetName()); $ftr->SendI($ftr->ConfigGetStartAs()); $ftr->SendI($this->ConfigGetStatusIs()); while ($this->ReadItemExists()) { $ftr->SendC($this->ReadC()); } $ftr->SendEND_AND_WAIT('+FTR'); $this->SendRETURN(); } } // Main ****************************************************** FactoryAdd('F1'); FactoryAdd('F2'); FactoryAdd('F3'); #fputs(STDERR, "111111111111111 -> " . join(", ", $argv) . "\n"); # first argument (the script-name) is not needed array_shift($argv); $srv = FactoryCall($argv[0]); try { $srv->LinkCreate($argv); $srv->ProcessEvent(MqS::WAIT_FOREVER); } catch (Exception $ex) { $srv->ErrorSet($ex); } $srv->Exit(); ?>
#§ \file theLink/example/php/MyServer.php #§ \brief \$Id$ #§ #§ (C) 2010 - NHI - #1 - Project - Group #§ #§ \version \$Rev$ #§ \author EMail: aotto1968 at users.berlios.de #§ \attention this software has GPL permissions to copy #§ please contact AUTHORS for additional information #§ class MyServer extends MqS implements iServerSetup { public function ServerSetup() { $this->ServiceCreate('HLWO', array(&$this, 'HLWO')); } public function HLWO() { $this->SendSTART(); $this->SendC("Hello World"); $this->SendRETURN(); } } $srv = FactoryAdd('MyServer')->New(); try { $srv->LinkCreate($argv); $srv->ProcessEvent(MqS::WAIT_FOREVER); } catch (Exception $ex) { $srv->ErrorSet($ex); } $srv->Exit();
$list[] = "<{$item}>"; } $this->data[] = $list; $this->SendRETURN(); } public function EOFcmd() { $ftr = $this->ServiceGetFilter(); foreach ($this->data as $list) { $ftr->SendSTART(); foreach ($list as $item) { $ftr->SendC($item); } $ftr->SendEND_AND_WAIT('+FTR'); } $ftr->SendSTART(); $ftr->SendEND_AND_WAIT('+EOF'); $this->SendRETURN(); } } $srv = FactoryAdd('filter', 'Filter1')->New(); try { $srv->LinkCreate($argv); $srv->ProcessEvent(MqS::WAIT_FOREVER); } catch (Exception $ex) { $srv->ErrorSet($ex); } $srv->Exit(); ?>
#§ \brief \$Id$ #§ #§ (C) 2010 - NHI - #1 - Project - Group #§ #§ \version \$Rev$ #§ \author EMail: aotto1968 at users.berlios.de #§ \attention this software has GPL permissions to copy #§ please contact AUTHORS for additional information #§ class Filter3 extends MqS implements iServerSetup { public function ServerSetup() { $ftr = $this->ServiceGetFilter(); $this->ServiceProxy("+ALL"); $this->ServiceProxy("+TRT"); $ftr->ServiceProxy("+ALL"); $ftr->ServiceProxy("+TRT"); } } $srv = FactoryAdd('Filter3')->New(); try { $srv->LinkCreate($argv); $srv->ProcessEvent(MqS::WAIT_FOREVER); } catch (Exception $ex) { $srv->ErrorSet($ex); } $srv->Exit(); ?>
public function ECOU() { $this->SendSTART(); $this->SendU($this->ReadU()); $this->SendRETURN(); } public function SETU() { $this->buf = $this->ReadU()->Dup(); } public function GETU() { $this->SendSTART(); $this->SendU($this->buf); $this->buf->Delete(); $this->SendRETURN(); $this->buf = NULL; } } $ctx = FactoryAdd('server', 'Server')->New(); try { $ctx->LinkCreate($argv); $ctx->LogC("test", 1, "this is the log test\n"); $ctx->ProcessEvent(MqS::WAIT_FOREVER); } catch (Exception $e) { $ctx->ErrorSet($e); } $ctx->Exit(); ?>
#§ class TestServer extends MqS implements iServerSetup { public function ServerSetup() { $this->ServiceCreate('GTCX', array(&$this, 'GTCX')); } public function GTCX() { $this->SendSTART(); $this->SendI($this->LinkGetCtxId()); $this->SendC("+"); if ($this->LinkIsParent()) { $this->SendI(-1); } else { $this->SendI($this->LinkGetParent()->LinkGetCtxId()); } $this->SendC("+"); $this->SendC($this->ConfigGetName()); $this->SendC(":"); $this->SendRETURN(); } } $srv = FactoryAdd('TestServer')->New(); try { $srv->LinkCreate($argv); $srv->ProcessEvent(MqS::WAIT_FOREVER); } catch (Exception $ex) { $srv->ErrorSet($ex); } $srv->Exit();
$id = $this->StorageSelect(); $this->ReadForward($ftr); } catch (Exception $ex) { $this->ErrorSet($ex); if ($this->ErrorIsEXIT()) { $this->ErrorReset(); return; } else { $this->ErrorWrite(); } } $this->StorageDelete($id); } } public function FilterIn() { $this->StorageInsert(); $this->SendRETURN(); } } $srv = FactoryAdd('transFilter', 'Filter6')->New(); try { $srv->LinkCreate($argv); $srv->ProcessEvent(MqS::WAIT_FOREVER); } catch (Exception $ex) { $srv->ErrorSet($ex); } $srv->Exit(); ?>