Reverted old code
parent
d5efddd10d
commit
6b0d439f7c
|
@ -17,12 +17,11 @@ readonly class Session {
|
|||
}
|
||||
|
||||
public function sendComposer(IMessageComposer $composer): void {
|
||||
$headerData = pack('n', 2491);
|
||||
$length = strlen($headerData);
|
||||
$lengthData = pack('N', $length);
|
||||
$binaryMessage = $lengthData . $headerData;
|
||||
$frame = new Frame($binaryMessage, true, Frame::OP_BINARY);
|
||||
$this->connection->send($frame);
|
||||
$message = new ServerMessage($composer->getHeader()->value);
|
||||
$composer->compose($message);
|
||||
$data = array_merge(ByteEncoding::int32ToArray(count($message->getPacket())), $message->getPacket());
|
||||
|
||||
$this->connection->send(new Frame(pack('C*', ...$data), true, Frame::OP_BINARY));
|
||||
}
|
||||
|
||||
function encode($text) {
|
||||
|
|
Loading…
Reference in New Issue