当前位置: 首页>>代码示例>>PHP>>正文


PHP SimpleSocket::isOpen方法代码示例

本文整理汇总了PHP中SimpleSocket::isOpen方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleSocket::isOpen方法的具体用法?PHP SimpleSocket::isOpen怎么用?PHP SimpleSocket::isOpen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SimpleSocket的用法示例。


在下文中一共展示了SimpleSocket::isOpen方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testSocketClosure

 public function testSocketClosure()
 {
     $socket = new SimpleSocket('www.lastcraft.com', 80, 15, 8);
     $this->assertTrue($socket->isOpen());
     $this->assertTrue($socket->write("GET /test/network_confirm.php HTTP/1.0\r\n"));
     $socket->write("Host: www.lastcraft.com\r\n");
     $socket->write("Connection: close\r\n\r\n");
     $this->assertEqual($socket->read(), "HTTP/1.1");
     $socket->close();
     $this->assertIdentical($socket->read(), false);
 }
开发者ID:Clansuite,项目名称:Clansuite,代码行数:11,代码来源:live_test.php

示例2: testSocketClosure

 public function testSocketClosure()
 {
     $socket = new SimpleSocket($this->host, $this->port, 15, 8);
     $this->assertTrue($socket->isOpen());
     $this->assertTrue($socket->write("GET /network_confirm.php HTTP/1.0\r\n"));
     $socket->write("Host: {$this->host}\r\n");
     $socket->write("Connection: close\r\n\r\n");
     $this->assertEqual($socket->read(), 'HTTP/1.0');
     $socket->close();
     $this->assertIdentical($socket->read(), false);
 }
开发者ID:simpletest,项目名称:simpletest,代码行数:11,代码来源:live_test.php

示例3: testSocket

 function testSocket()
 {
     $socket = new SimpleSocket("www.lastcraft.com", 80);
     $this->assertFalse($socket->isError(), "Error [" . $socket->getError() . "]");
     $this->assertTrue($socket->isOpen());
     $this->assertTrue($socket->write("GET www.lastcraft.com/test/network_confirm.php HTTP/1.0\r\n"));
     $socket->write("Host: localhost\r\n");
     $socket->write("Connection: close\r\n\r\n");
     $this->assertEqual($socket->read(8), "HTTP/1.1");
     $socket->close();
     $this->assertEqual($socket->read(8), "");
 }
开发者ID:adamfranco,项目名称:harmoni,代码行数:12,代码来源:live_test.php

示例4: testSocketClosure

 function testSocketClosure()
 {
     $site = $this->getServerInfo();
     $socket = new SimpleSocket($site['host'], $site['port'], 15, 8);
     $this->assertTrue($socket->isOpen());
     $this->assertTrue($socket->write("GET {$site['path']}network_confirm.php HTTP/1.0\r\n"));
     $socket->write("Host: {$site['host']}\r\n");
     $socket->write("Connection: close\r\n\r\n");
     $this->assertEqual($socket->read(), "HTTP/1.1");
     $socket->close();
     $this->assertIdentical($socket->read(), false);
 }
开发者ID:GerHobbelt,项目名称:simpletest,代码行数:12,代码来源:live_test.php

示例5: skip

 function skip()
 {
     $socket = new SimpleSocket($this->host, $this->port, 5, 8);
     parent::skipIf(!$socket->isOpen(), sprintf('The LiveHttpTestCase requires that a webserver runs at %s:%s', $this->host, $this->port));
 }
开发者ID:simpletest,项目名称:simpletest,代码行数:5,代码来源:acceptance_test.php


注:本文中的SimpleSocket::isOpen方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。