/** * Send a text message to the remote endpoint. * * @param string $text The text to be sent (must be UTF-8 encoded). * @param int $priority Message priority. * @return int Number of transmitted bytes. * * @throws \InvalidArgumentException When the given message is not UTF-8 encoded. */ public function sendText(string $text, int $priority = 0) : Awaitable { return $this->writer->sendText($text, $priority); }