From f43ab913c7595aa2b773cde44a0be12a5be6c85a Mon Sep 17 00:00:00 2001 From: Chris Boden Date: Sun, 15 Jul 2012 12:15:54 -0400 Subject: [PATCH] [WebSocket] Closing frame bug fix --- src/Ratchet/WebSocket/Version/RFC6455/Connection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ratchet/WebSocket/Version/RFC6455/Connection.php b/src/Ratchet/WebSocket/Version/RFC6455/Connection.php index c1c3f7c..acd5bb6 100644 --- a/src/Ratchet/WebSocket/Version/RFC6455/Connection.php +++ b/src/Ratchet/WebSocket/Version/RFC6455/Connection.php @@ -23,7 +23,7 @@ class Connection extends AbstractConnectionDecorator { if ($code instanceof DataInterface) { $this->send($code); } else { - $this->send(new Frame(Frame::encode(sprintf('%016b', $code)), true, Frame::OP_CLOSE)); + $this->send(new Frame(pack('n', $code), true, Frame::OP_CLOSE)); } $this->getConnection()->close();