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

206
Vistas
xhttp.send works once but fails the 2nd time

I have the following javascript that works happily the 1st time but fails the second time..

    xhttp = new XMLHttpRequest();               
    xhttp.open("POST","FINDMOVES",false);
    xhttp.send(text);       

This send is actually being received by the server and a respone is written by the server. The server is my own and written in assembler. The java console reports:-

POST http://localhost:1024/FINDMOVES net::ERR_EMPTY_RESPONSE Uncaught DOMException: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://localhost:1024/FINDMOVES'.

This code works happily where it is used in other programs.

I am aware that:- "[Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience" but it is not java's decision as to what my end user experience is like. It is mine.

Anyone got any clues ??

further to this...(and some background) I have a runtime module that acts as a web server. This is used to serve on-line programs and therefore be portable between windows/linux. It is statically linked to application programs. I have a dozen application programs happily using this server. I have 1 near identical application that is okay but it's "twin" progran is failing. I have been stepping through the programs for a couple of days now and I have noticed the following:-

The SYS_ACCEPT call returns the same file descriptor for all programs that work while in the failing program, after a few calls, it returns a different file descriptor and as soon as that is the case the web browser does not see the response (even though it was written without error)

Anyone know what's going on here ?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The answer to this is not what I would have expected and I came across it completely by accident when I commented out some file access in the application program to make the strace ouput clearer.

The application was at fault in that it opened a file in an initialisation section but mistakenly closed it each time it sent a response back to the server. It effect it opened once but closed many times. In some way this confused the linux kernel (?) and it was made evident in the SYS_ACCEPT call.

I have to admit, I do not understand why this occurs so if someone can shed some light on why this happens I would appreciate it. For now though it looks like everything is back to working again.

Oh, I was getting a -512 back from the SYS_ACCEPT call but could never find out what that represented. Perhaps it means "Hey dude, stop closing that bloody file" !!

about 4 years ago · Juan Pablo Isaza Denunciar
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