Fixed frame creation type bug

This commit is contained in:
Chris Boden 2016-02-27 13:02:56 -05:00
parent 2283bdf288
commit bbced3b765

View File

@ -15,7 +15,7 @@ class WsConnection extends AbstractConnectionDecorator {
public function send($msg, $isBinary = false) { public function send($msg, $isBinary = false) {
if (!$this->WebSocket->closing) { if (!$this->WebSocket->closing) {
if (!($msg instanceof DataInterface)) { if (!($msg instanceof DataInterface)) {
$msg = new Frame($msg, true, ((boolean)$isBinary ? Frame::OP_TEXT : Frame::OP_BINARY)); $msg = new Frame($msg, true, ((boolean)$isBinary ? Frame::OP_BINARY : Frame::OP_TEXT));
} }
$this->getConnection()->send($msg->getContents()); $this->getConnection()->send($msg->getContents());