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

207
Views
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 answers
Answer question

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 Report
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!