本文整理汇总了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);
}
示例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));
}
示例3: pingPong
/**
* @param IrcDataObject $data
*/
public function pingPong(IrcDataObject $data)
{
$this->parent->write($this->parent->getGenerator()->ircPong($data->getParams()['server1']));
}
示例4: send
public function send()
{
if ($this->conn->write() === false) {
$this->finish('BROKEN');
}
}
示例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();
}
示例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();
}