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


PHP SimpleSocket::getSent方法代码示例

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


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

示例1: testRecordOfSentCharacters

 public function testRecordOfSentCharacters()
 {
     $socket = new SimpleSocket('www.lastcraft.com', 80, 15);
     $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");
     $socket->close();
     $this->assertEqual($socket->getSent(), "GET /test/network_confirm.php HTTP/1.0\r\n" . "Host: www.lastcraft.com\r\n" . "Connection: close\r\n\r\n");
 }
开发者ID:Clansuite,项目名称:Clansuite,代码行数:9,代码来源:live_test.php

示例2: testRecordOfSentCharacters

 public function testRecordOfSentCharacters()
 {
     $socket = new SimpleSocket($this->host, $this->port, 15);
     $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");
     $socket->close();
     $this->assertEqual($socket->getSent(), "GET /network_confirm.php HTTP/1.0\r\n" . "Host: {$this->host}\r\n" . "Connection: close\r\n\r\n");
 }
开发者ID:simpletest,项目名称:simpletest,代码行数:9,代码来源:live_test.php

示例3: testRecordOfSentCharacters

 function testRecordOfSentCharacters()
 {
     $site = $this->getServerInfo();
     $socket = new SimpleSocket($site['host'], $site['port'], 15);
     $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");
     $socket->close();
     $this->assertEqual($socket->getSent(), "GET {$site['path']}network_confirm.php HTTP/1.0\r\n" . "Host: {$site['host']}\r\n" . "Connection: close\r\n\r\n");
 }
开发者ID:GerHobbelt,项目名称:simpletest,代码行数:10,代码来源:live_test.php

示例4: SimpleHttpResponse

 /**
  *    Constructor. Reads and parses the incoming
  *    content and headers.
  *    @param SimpleSocket $socket   Network connection to fetch
  *                                  response text from.
  *    @param SimpleUrl $url         Resource name.
  *    @param mixed $encoding        Record of content sent.
  *    @access public
  */
 function SimpleHttpResponse(&$socket, $url, $encoding)
 {
     $this->SimpleStickyError();
     $this->_url = $url;
     $this->_encoding = $encoding;
     $this->_sent = $socket->getSent();
     $this->_content = false;
     $raw = $this->_readAll($socket);
     if ($socket->isError()) {
         $this->_setError('Error reading socket [' . $socket->getError() . ']');
         return;
     }
     $this->_parse($raw);
 }
开发者ID:JackCanada,项目名称:moodle-hacks,代码行数:23,代码来源:http.php

示例5: SimpleHttpResponse

 /**
  *    Constructor. Reads and parses the incoming
  *    content and headers.
  *    @param SimpleSocket $socket   Network connection to fetch
  *                                  response text from.
  *    @param string $method         HTTP request method.
  *    @param SimpleUrl $url         Resource name.
  *    @param mixed $request_data    Record of content sent.
  *    @access public
  */
 function SimpleHttpResponse(&$socket, $method, $url, $request_data = '')
 {
     $this->StickyError();
     $this->_method = $method;
     $this->_url = $url;
     $this->_request_data = $request_data;
     $this->_sent = $socket->getSent();
     $this->_content = false;
     $raw = $this->_readAll($socket);
     if ($socket->isError()) {
         $this->_setError('Error reading socket [' . $socket->getError() . ']');
         return;
     }
     $this->_parse($raw);
 }
开发者ID:BGCX067,项目名称:ezpdo2-svn-to-git,代码行数:25,代码来源:http.php

示例6:

 /**
  *    Constructor. Reads and parses the incoming
  *    content and headers.
  *    @param SimpleSocket $socket   Network connection to fetch
  *                                  response text from.
  *    @param SimpleUrl $url         Resource name.
  *    @param mixed $encoding        Record of content sent.
  *    @access public
  */
 function __construct($socket, $url, $encoding)
 {
     parent::__construct();
     $this->url = $url;
     $this->encoding = $encoding;
     $this->sent = $socket->getSent();
     $this->content = false;
     $raw = $this->readAll($socket);
     if ($socket->isError()) {
         $this->setError('Error reading socket [' . $socket->getError() . ']');
         return;
     }
     $this->parse($raw);
 }
开发者ID:reevoo,项目名称:reevoomark-php-api,代码行数:23,代码来源:http.php


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