Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

224
Views
enviar un mensaje de websocket superior a 64kB hace que el servidor de websocket de Ratchet arroje una 'excepción de subdesbordamiento'

tengo un servidor websocket escrito en php usando ratchet websocket, y los clientes están escritos en javascript creando una conexión websocket para conectarse al servidor php websocket.

El cliente y el servidor se comunican a través de una cadena json, descubrí que cuando el tamaño del mensaje json es superior a 64 kB, el servidor ratchet generaría una 'excepción de subdesbordamiento'

'UnderflowException' con el mensaje 'El marco debe fusionarse antes de aplicar la máscara'

código del servidor php

 use Ratchet\Server\IoServer; use Ratchet\Http\HttpServer; use Ratchet\WebSocket\WsServer; use MyApp\Socket; $server = IoServer::factory( new HttpServer( new WsServer( new Socket() ) ), 8080 ); $server->run();

cliente javascript

 var socket = new WebSocket('ws://123.123.123.123:8080'); let reader = new FileReader(); reader.onload = function() { sendPackageImageFile(reader.result); }; reader.onerror = function() { console.log('reader.error'); }; reader.readAsDataURL('some-file'); function sendPackageImageFile(imageFileData) { var message = {}; message.sender = 'someUser'; message.action = 'send-package-image'; message.packer = 'packer'; message.data = 'some data'; message.file = imageFileData; const js = JSON.stringify(message); socket.send(js); }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!