473,503 Members | 1,768 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XMLHttpRequest() and persistent connections

I have a web app, written in Javascript, that communicates to a back-end
server via XMLHttpRequest.

The logic goes:

* Login
* Perform transaction
* (delay while the user does something)
* Perform transaction
* ...
* Logout

It would be really convenient if I could make the whole thing a single HTTP
connection. That way, I avoid needing IPC and session management at the
server end, and a single instance of a CGI script can represent the entire
session. When the socket gets closed, the CGI script terminates and
implicitly logs the user off. All very simple.

Can I use HTTP pipelining with XMLHttpRequest to do this? The docs seem to
say (it's quite hard to tell) that I have to call open() after each send(),
which will presumably create a new HTTP session. Can I 'persuade' the
browser to reuse an existing session?

--
+- David Given --McQ-+
| dg@cowlark.com | "I have a mind like a steel trap. It's rusty and
| (dg@tao-group.com) | full of dead mice." --- Anonymous, on rasfc
+- www.cowlark.com --+

Jul 23 '05 #1
3 8562


David Given wrote:
I have a web app, written in Javascript, that communicates to a back-end
server via XMLHttpRequest.

The logic goes:

* Login
* Perform transaction
* (delay while the user does something)
* Perform transaction
* ...
* Logout

It would be really convenient if I could make the whole thing a single HTTP
connection.


It might be that XMLHttpRequest in Mozilla has a feature for some time
now that could help, see
<https://bugzilla.mozilla.org/show_bug.cgi?id=237319>
that is fixed and added support for multipart/x-mixed-replace.
I haven't used that but what I have read there comes close to what you
describe above.
But given the limited implementations of XMLHttpRequest in Opera or
Safari so far I have doubts it will work there.
Not sure whether MSXML/IE can handle that.

Please report back to the group whether that multipart/x-mixed-replace
feature of XMLHttpRequest in Mozilla is useful for you.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
Martin Honnen wrote:
[...]
Please report back to the group whether that multipart/x-mixed-replace
feature of XMLHttpRequest in Mozilla is useful for you.


I've had a look at that; it allows the server to send multiple responses
back to the client down the same HTTP session, but I don't know if it
allows multiple two-way *transactions* down the same HTTP session.

--
+- David Given --McQ-+ "Apatheism: the school of belief where on doesn't
| dg@cowlark.com | particularly care if there is/are god(s)." ---
| (dg@tao-group.com) | Capt. Gym Z. Quirk
+- www.cowlark.com --+

Jul 23 '05 #3


David Given wrote:
Martin Honnen wrote:
Please report back to the group whether that multipart/x-mixed-replace
feature of XMLHttpRequest in Mozilla is useful for you.

it allows the server to send multiple responses
back to the client down the same HTTP session, but I don't know if it
allows multiple two-way *transactions* down the same HTTP session.


In my understanding the client with XMLHttpRequest will do one request
and then be able to receive multiple responses but indeed multiple
two-way exchange is not possible that way.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2777
by: Randell D. | last post by:
Folks, I currently connect to my db with PHP code that uses non-persistent connections. I've read that persistent connections can help performance since a connection to the db will use an...
2
8495
by: Steve Jenkins | last post by:
Wonder if anyone can help. So, I've read: >> http://uk2.php.net/function.mysql-pconnect >> http://uk2.php.net/manual/en/features.persistent-connections.php Can one seriously see persistent...
4
4382
by: M. Katz | last post by:
I'm relatively new to PHP/MySQL and I've heard about maintaining a persistent connection to the database. To save overhead, I'd like to maintain the connection in a session variable, but I have a...
5
2786
by: Felix E. Klee | last post by:
I've set up a PHP web application where users can log in and open a connection to a NNTP-server. There is a *one-to-one* relationship between sessions and NNTP-connections (i.e. exactly one...
1
3305
by: Chris Spencer | last post by:
I noticed the SimpleXMLRPCServer/ServerProxy creates a new socket for remote procedure call. I've written a simple IP based authentication scheme for the Server, and I'd like to include the port in...
2
2013
by: David Haynes | last post by:
If I do $conn = new msqli(...); do I automatically get persistent connections? If not, how do I get them? Fall back to pconnect()? -david-
2
2977
by: Jim Hubbard | last post by:
Is it possible to have persistent connections in ASP.Net?
0
876
by: manji | last post by:
I had a problem with persistent connections and had to disable in on the webserver. Now i found out that the ASP.net debugger will not function if persistent connections are disabled. I hope...
1
1874
by: Paul Wagstaff | last post by:
Access 03 Runtime / Win XP Hi folks I wonder if I can tap the wizards for some general advice.. What are the risks/penalities/drawbacks for having a persistent connection to a back-end mdb? ...
0
7199
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6984
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5576
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5005
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4670
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3162
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3151
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1507
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.