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


PHP Connection::write方法代码示例

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


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

示例1: send

 /**
  * @param string $message
  * @param string $from
  * @param string $color
  *
  * @throws \RuntimeException
  */
 public function send($message, $from, $color = null)
 {
     $data = ['room_id' => $this->name, 'message' => $message, 'from' => $from];
     if ($color) {
         $data['color'] = $color;
     }
     $this->connection->write('/v1/rooms/message', $data);
 }
开发者ID:oqq,项目名称:minc-hipchat,代码行数:15,代码来源:Room.php

示例2: quitCommand

 public function quitCommand($command, $params, IrcDataObject $data)
 {
     $auth = $this->parent->getModule('Auth');
     if (!$auth->nicknameIsTrusted($data->getMessage()['nick'])) {
         return;
     }
     $message = empty($params) ? 'WildPHP shutting down...' : $params;
     $this->parent->write($this->parent->getGenerator()->ircQuit($message));
 }
开发者ID:WildPHP,项目名称:module-ircconnection,代码行数:9,代码来源:Commands.php

示例3: pingPong

 /**
  * @param IrcDataObject $data
  */
 public function pingPong(IrcDataObject $data)
 {
     $this->parent->write($this->parent->getGenerator()->ircPong($data->getParams()['server1']));
 }
开发者ID:WildPHP,项目名称:module-ircconnection,代码行数:7,代码来源:PingPongHandler.php

示例4: send

 public function send()
 {
     if ($this->conn->write() === false) {
         $this->finish('BROKEN');
     }
 }
开发者ID:qianyunlai,项目名称:httpclient-1,代码行数:6,代码来源:Processor.php

示例5: write

 function write()
 {
     if ($this->current_client == null) {
         if (empty($this->client_queue)) {
             return;
         }
         $this->current_client = $this->client_queue[0];
     }
     while ($packet = array_shift($this->current_client->packets_read)) {
         $this->write_buffer->append($packet->binary);
     }
     parent::write();
 }
开发者ID:giant-rabbit,项目名称:mysql-concentrator,代码行数:13,代码来源:MySQLConnection.php

示例6: write

 function write()
 {
     //    $this->log("Writing to client.\n");
     while ($packet = array_shift($this->write_packets)) {
         $this->write_buffer->append($packet->binary);
     }
     parent::write();
 }
开发者ID:giant-rabbit,项目名称:mysql-concentrator,代码行数:8,代码来源:ClientConnection.php


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