Sponsored Content
Top Forums Programming Run two CGIs simultaneously and Ajax to read updated value from CGI1 Post 302428700 by xs2punit on Thursday 10th of June 2010 02:13:16 PM
Old 06-10-2010
Run two CGIs simultaneously and Ajax to read updated value from CGI1

Flow of program:
C based CGI is used

CGI1:
-Gets called when user hits upload button(submit) ie form action = CGI1
-Does the file upload (copy to a directory etc)

JS, Ajax fucntion:
-A JS function is called when user hits upload button
-The JS function opens an Ajax request for CGI2
-Ajax keeps polling CGI2 for updated value

CGI2:
-Contains:
system ("some cmd to get directory size");

Issue:
Ajax is not able to read values from CGI2 as it polls to get updated values after every 1 sec. It is able to get last value.
In some cases it is able to get 1-2 other values but not EVERY TIME.

Logically my program is fine. I have tested running CGI2 separately, it works fine. I have tested Ajax, and no issues with it as well. The status which it receives is 0 or sometimes 500.
However, altogether, it is not working.

Possible cause:
-Environment issue
-Running 2 CGIs simultaneously
-System() command used in CGI2 is not the right way to get output for Ajax


Any suggestion/solution would be really appreciable.



Thanks
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

run serveral loops simultaneously?

Hello everyone, say I have the following script, which contains serveral loops, if I run the script, it executes the loop one by one (after the a loop, it goes to b loop, then c, then d) I figured I should be able to run all the loops at same time, but I don't know how, can anyone help a little... (2 Replies)
Discussion started by: fedora
2 Replies

2. Shell Programming and Scripting

Run a command in bg simultaneously with

Hi, I want to run the command below in the background: tail -f file.txt | grep "pattern" The file file.txt will start getting its contents written after this command has started getting run. So the flow will be like this tail -f file.txt | grep "pattern" #The line below will write data... (0 Replies)
Discussion started by: King Nothing
0 Replies

3. Shell Programming and Scripting

[Help] script how to run 2 commands simultaneously

#!/bin/sh firefox index.html firefox secondpage.html hey guys, im not able to open up two pages at the same time... it always open up index.html first, and only after i close it, then the 2nd page pops up... is there any way i can run both commands at the same time? i appreciate any... (2 Replies)
Discussion started by: funnyguy123
2 Replies

4. UNIX for Dummies Questions & Answers

Read same file simultaneously with two different programs

Hi all, I was just wondering if there are any consequences, or if its a problem to have a multiple scripts parsing (reading) the same file simultaneously. For example, I have file.txt with lots of information. cat script1.sh grep "awesome" file1.txt > awesome.txt cat script2.sh grep -v... (4 Replies)
Discussion started by: torchij
4 Replies

5. Shell Programming and Scripting

Read Line is not Updated

Hi, Is there a way to reflect the recent changes in the file being read when using "while read line" loop? Thanks! script: while read line do echo $line cat x.dat|sed 's/2/6/g' > x.dat.temp mv x.dat.temp x.dat done < x.dat The results is still getting below, even... (2 Replies)
Discussion started by: zzavilz
2 Replies

6. Shell Programming and Scripting

Read file and run a command

Hi I have jobs (some 1000) defined in a file and I want to read those jobs and run a a command. For example: jobs.txt abc efg I want to read the entire file and run the following command Delete -JOB "abc" Deleteing abc... Delete -JOB "efg" Delete efg... Can somebody help me... (4 Replies)
Discussion started by: karan8810
4 Replies

7. Shell Programming and Scripting

Run 2 shell scripts simultaneously from one script

i Run 2 scripts on all of around 50 nodes every day. 1.Mod_1.sh 2.Mod_2.sh eg.. i run file with specific node no like Mod_1.sh NODE_(node number) Mod_2.sh NODE_(node number) I want to run both file by using single script with unique node number. Eg.. Mod_new.sh NODE_(node... (11 Replies)
Discussion started by: Ganesh Mankar
11 Replies

8. Shell Programming and Scripting

Shell script has to run until the status value is updated

Hi All, Need some help like how to exit from the script after updating the column in data base. db2 connect to DB STATUS=$(db2 "SELECT STATUS FROM XYZ ) echo $STATUS Initially the status value will be '4' or 'NOT YET RUN'. The Shell script has to run until the status value is updated... (7 Replies)
Discussion started by: sumanmca2006
7 Replies

9. Shell Programming and Scripting

How to run feeding each other processes simultaneously?

Hello, I need to run multiple shell processes simultaneously and output of the first process shall be the input of the second process but first process is never ending so both should be running in parallel. I do not wish to wait the end of the first process. I am under ubuntu 16.04. ... (3 Replies)
Discussion started by: baris35
3 Replies
Dancer::Plugins(3pm)					User Contributed Perl Documentation				      Dancer::Plugins(3pm)

NAME
Dancer::Plugins - interesting plugins to add to Dancer's capabilities DESCRIPTION
Dancer aims to keep the core as small as possible, but there are a growing number of useful plugins to add helpful features. This document provides a quick summary of some recommended plugins. PLUGINS
Dancer::Plugin::Database Provides easy database access via DBI, reading the DB connection details from your app's config file, and taking care of ensuring the connection is still valid and reconnecting if not (useful in persistent environments). Just calling the "database" keyword gives you a connected and working database handle. It also provides some helpful keywords to make inserting/updating data as simple as it should be. Dancer::Plugin::DBIC Provides easy acces to DBIx::Class database virtualization. Dancer::Plugin::Auth::RBAC Dancer Authentication, Security and Role-Based Access Control Framework. Dancer::Plugin::Email Provides easy email-sending powered by Email::Send - simply call the "email" keyword. Email sending settings can be taken from your app's config. Dancer::Plugin::SMS Send SMS text messages to mobile phones from your Dancer app, using any service supported by SMS::Send. Dancer::Plugin::Ajax Provides easy way to add Ajax route handlers. Dancer::Plugin::REST Makes writing RESTful web services easy. Dancer::Plugin::SiteMap Automatically provides site maps (as a HTML page, or as an XML sitemap ready for Google) based on the routes your app defines. Dancer::Plugin::Validation Easy data validation powered by Oogly. Dancer::Plugin::Params::Normalization Provides different ways of normalizing parameter names Dancer::Plugin::SimpleCRUD Provides easy CRUD (create, read, update, delete) facilities, automatically creating routes to display, add, edit and delete data from a database table. Dancer::Plugin::WebSocket Supports building apps using Web Sockets for bi-directional, full-duplex communications over a long-lived socket connection. Dancer::Plugin::Memcached Cache page responses or individual items of data with memcached for performance. Dancer::Plugin::MobileDevice Quickly determine whether the client is a mobile browser, in order to offer a simplified layout, or otherwise customise features. Dancer::Plugin::NYTProf Provides dead-simple profiling of your app using Devel::NYTProf - enables profiling for each request individually, serves up a list of profiling runs, and generates & sends the HTML reports produced by "nytprofhtml". Dancer::Plugin::Bcrypt Provides simple effective password hashing and validation using Bcrypt. Dancer::Plugin::Cache::CHI Provides caching for generated pages and/or arbitrary data. Uses CHI, so is backend-agnostic - caching can be done in memory, to files, using Memcache, in a database, or any other method for which there is a CHI::Driver module. Dancer::Plugin::Thumbnail Easy thumbnail generation using GD. Dancer::Plugin::Captcha::SecurityImage Easy CAPTCHA image generation and validation, using GD. Dancer::Plugin::Facebook Easily work with Facebook's Graph API from your Perl Dancer app. Uses Facebook::Graph. Dancer::Plugin::Redis Easy Redis database connections, based upon Dancer::Plugin::Database. Dancer::Plugin::XML::RSS Easy XML RSS creation and consumption. More plugins are appearing on CPAN all the time - just search for "Dancer::Plugin" to see what may have been released since this document was last updated! perl v5.14.2 2011-11-30 Dancer::Plugins(3pm)
All times are GMT -4. The time now is 07:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy