LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-24-2007, 10:40 PM   #1
simon_qwl
Member
 
Registered: Jul 2004
Posts: 34

Rep: Reputation: 15
AJAX:how to receive data from CGI successively


Hi, as the statement, I am trying to do a ping testing page by using AJAX. my intention is the xmlHttp could receive each printf("...") from CGI individually and successively, and then update the content of the testing page. Unfortunately, it only receives all data after the CGI program is terminated.
The web-server is BOA. I just started to learn AJAX,therefore don't fully understand the procedures.
Please let me know how you guys achieve the similar objectives or any special requirements for web-server to support?
Thanks in advance.
 
Old 04-26-2007, 08:53 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Hi

I really don't know about Ajax and CGI scripts. But remember stdout is buffered by default in C programs. Maybe add a "fflush(stdout)" after the printf? It might not work since the web server can do buffering as well, but it might be worth a try.

Last edited by Guttorm; 04-26-2007 at 10:24 AM.
 
Old 04-26-2007, 10:10 PM   #3
simon_qwl
Member
 
Registered: Jul 2004
Posts: 34

Original Poster
Rep: Reputation: 15
Hi Guttorm,
Yes,it works now. thank you very much for your hints. Actually I finally found something called "server push" technology, and it perfectly suits my needs.guess what? I found the "fflush(stdout)" in all the CGI samples.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to receive data in an udp socket stephenwalter Programming 8 11-24-2005 11:20 PM
bandwidth limiting on receive data per ip address lindani Linux - Networking 2 06-09-2005 08:11 AM
can i send or receive data in compress form to internet alvi2 Linux - Networking 1 03-05-2005 07:48 AM
cannot receive data larger than several tens KB, fedora core 2 seraph123 Linux - Networking 1 08-11-2004 04:25 PM
How to receive Data-CD-ROM name? razem Programming 0 12-25-2003 12:12 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration