Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

160
Vistas
Is there a way to block while waiting for a websocket response in the browser?

Perhaps by (mis)using some legacy API?
Are there browser plugins that can do this?

I am in a controlled environment, so solutions involving browser plugins or browser modifications are welcome.

Background:
I have some JS running in an embedded JavaScript VM, using custom methods exposed from C++. These custom methods are synchronous (there is no need for them to be asynchronous).

For testing and development, I want to be able to run the same JS code in the browser. As the browser does not have my custom C++ methods, I need to call them remotely. Today, I'm using a blocking XMLHttpRequest (deprecated in most browsers, but still works) to do this.

The problem is that making an HTTP-request has some overhead and is relatively slow (in the 20-50 ms range). WebSockets are much faster (roundtrip in a few ms), but as they are inherently asynchronous, I can't use it to replace my blocking functions.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda