Menu
Reference
- Manticore\Ds
- Async
- Http
- Http\WebSocket
- Interfaces
- Handler
- Classes
- Connection
- ConnectionClosedException
- HandshakeException
- Hub
- Message
- Options
- Functions
- connect()
- handler()
- run()
- upgrade()
- Buffer
- Process
- Io\Poll
- Manticore\Sapi
- Ffi
Message
finalclass
final class Message
One received message.
$data is the whole message after fragments are reassembled and, when
permessage-deflate is on, decompressed. A text message is guaranteed to be
valid UTF-8 (otherwise the connection closes with 1007). $binary tells a
binary message from a text one.
See also: Connection::receive
Methods
__construct() | Create a message. |
__construct()#source
function __construct(public string $data, public bool $binary)
Create a message. Received messages are built by the connection; this is useful for tests and fakes.
Parameters
$datastring- the message payload
$binarybool- true for a binary message, false for text