當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。