Category : ratchet

i have a websocket server written in php using ratchet websocket, and the clients are written in javascript creating websocket connection to connect to the php websocket server. Client and server are communicating via json string, i found that when the json message size is greater than 64kB, the ratchet server would throw an ‘underflow ..

Read more

i have just try like : var conn = new WebSocket(‘ws://localhost:8091’); conn.onopen = function(e) { console.log(“Connection established!”); }; conn.onmessage = function(e) { console.log( ‘on Advertiser’, e.data ); }; conn.customeSend = function(e) { console.log( ‘on Advertiser’, e.data ); }; function changeInbfcDashboard(){ // conn.send(JSON.stringify({command: “subscribe”})); var inProgressCount = 5; conn.send(JSON.stringify({inProgressCount:inProgressCount})); } function subscribe(channel) { conn.send(JSON.stringify({command: “subscribe”, channel: ..

Read more

I use Ratchet to build Realtime for Project Cakephp. I can sent message to clients but I can’t save message to database. When I use loadModel to start save data, it has error. Class: namespace AppController; use RatchetConnectionInterface; use RatchetMessageComponentInterface; class WebsocketController extends AppController implements MessageComponentInterface { protected $clients; Function: public function onMessage(ConnectionInterface $from, $msg) ..

Read more