示例#1
0
 public function connect()
 {
     return parent::connect();
 }
示例#2
0
 /**
  * @expectedException InvalidArgumentException
  */
 public function testSendInvalidTypeString()
 {
     $client = new Client('ws://localhost/test', 'http://example.org/');
     $client->sendData('blah', 'fooey');
 }
示例#3
0
 public function fetchSocket($url)
 {
     $hosts = $this->di->get('config')->websocketd->hosts->toArray();
     shuffle($hosts);
     $host = reset($hosts);
     $instance = new Client($host, 'http://www.shopbigbang.com/');
     $success = $instance->connect();
     $bytes = $instance->sendData($url, Protocol::TYPE_TEXT);
     $responses = $instance->receive();
     $instance->disconnect();
     return (string) reset($responses);
 }