コード例 #1
0
 /**
  * Reactor constructor.
  * @param Machine $machine
  * @param Path $path
  */
 public function __construct(Machine $machine, Path $path)
 {
     $this->buffer = new Buffer();
     $this->stock = new Dumper(new Stock($path));
     $this->loop = Factory::create();
     $this->address = $machine->getAddress();
     $this->port = $machine->getPort();
 }
コード例 #2
0
 /**
  * @param InputInterface $input
  * @param OutputInterface $output
  * @throws \Exception
  * @return boolean
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     if ($input->getOption('option')) {
         // ...
     }
     $machine = new Machine($input->getArgument('machine'));
     $socket = new Connector\Socket($machine->getProtocol(), $machine->getAddress(), $machine->getPort());
     $socket->openStream();
     while (!feof($socket->socket)) {
         $contents = $socket->read(1);
         echo $contents;
     }
     return true;
 }
コード例 #3
0
ファイル: Sender.php プロジェクト: jetalone/monotypeinstaller
 /**
  * Cannon constructor.
  * @param Machine $machine
  */
 public function __construct(Machine $machine)
 {
     $this->address = $machine->getAddress();
     $this->port = $machine->getPort();
 }