473,325 Members | 2,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Active time for HTTP connection

Hi,

I am trying to use Ajax to connect with an HTTP server and do some
interactions. The first HTTP request will be longer than others due to
the 3-way hand shake. So I'd like to reuse that TCP channel to avoid
connect again. I wonder the active time for javascript to keep that
HTTP connection alive, so that I could make use of that time to
optimize each connection. Thanks in advance.
Nov 16 '07 #1
5 2671
campos wrote:
I am trying to use Ajax to connect with an HTTP server and do some
interactions. The first HTTP request will be longer than others due to
the 3-way hand shake.
(You are referring to
<news:mc******************@newssvr25.news.prodigy. net>; please continue the
thread next time.)

You got it all wrong. It is not the TCP handshake to establish the
connection that *can* make the first transmission slower.
So I'd like to reuse that TCP channel to avoid connect again.
"TCP channel"? Are you sure you know what you are doing?
I wonder the active time for javascript to keep that
HTTP connection alive,
There is none as "javascript" does not do that; the HTTP client does, caused
by an implementation of the IXMLHTTPRequest interface that is only used
*through* an ECMAScript implementation (such as JavaScript or JScript), if that.
so that I could make use of that time to optimize each connection.
Thanks in advance.
Persistent HTTP connections are maintained server-side. There has to be an
HTTP/1.1-capable server that needs to support that. And if the server
supports it, the next message has to be sent before the server-defined wait
time runs out.

http://httpd.apache.org/docs/1.3/keepalive.html
http://tools.ietf.org/html/rfc2068#section-8.1
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Nov 16 '07 #2
VK
On Nov 16, 4:23 am, campos <huwen...@gmail.comwrote:
Hi,

I am trying to use Ajax to connect with an HTTP server and do some
interactions. The first HTTP request will be longer than others due to
the 3-way hand shake. So I'd like to reuse that TCP channel to avoid
connect again. I wonder the active time for javascript to keep that
HTTP connection alive, so that I could make use of that time to
optimize each connection.
As it was pointed out, JavaScript doesn't handle HTTP transmissions,
it is a system-level feature.

For IE / Windows with default registry settings, on Keep-Alive the TCP/
IP socked gets freed after 60sec (1 min) of inactivity. For an
intranet solution you may set bigger KeepAliveTimeout for all involved
machines in HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion
\InternetSettings

For the Internet one of workarounds would be to make a "slow page"
over script, so dripping the response by small chunks every say 5sec
until the data is ready - then flush the rest of the page. Can be very
irritating though for end-users.
Nov 17 '07 #3
VK
On Nov 17, 3:39 pm, VK <schools_r...@yahoo.comwrote:
For IE / Windows with default registry settings, on Keep-Alive the TCP/
IP socked gets freed after 60sec (1 min) of inactivity. For an
intranet solution you may set bigger KeepAliveTimeout for all involved
machines in HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion
\InternetSettings
I have found this KB article that covers the matter more fully:

http://support.microsoft.com/kb/813827
Nov 17 '07 #4
On Nov 16, 11:37 pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
campos wrote:
I am trying to use Ajax to connect with an HTTP server and do some
interactions. The first HTTP request will be longer than others due to
the 3-way hand shake.

(You are referring to
<news:mc******************@newssvr25.news.prodigy. net>;please continue the
thread next time.)

You got it all wrong. It is not the TCP handshake to establish the
connection that *can* make the first transmission slower.
Well, then what makes the first transmission longer? I'm thinking that
it takes another RTT to establish the connection for the first HTTP
request. In my situation, RTT is about 170ms, which is negligible.
>
So I'd like to reuse that TCP channel to avoid connect again.

"TCP channel"? Are you sure you know what you are doing?
I wonder the active time for javascript to keep that
HTTP connection alive,

There is none as "javascript" does not do that; the HTTP client does, caused
by an implementation of the IXMLHTTPRequest interface that is only used
*through* an ECMAScript implementation (such as JavaScript or JScript), if that.
so that I could make use of that time to optimize each connection.
Thanks in advance.

Persistent HTTP connections are maintained server-side. There has to be an
HTTP/1.1-capable server that needs to support that. And if the server
supports it, the next message has to be sent before the server-defined wait
time runs out.

http://httpd.apache.org/docs/1.3/kee...68#section-8.1

PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Nov 18 '07 #5
campos wrote:
On Nov 16, 11:37 pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
>campos wrote:
>>I am trying to use Ajax to connect with an HTTP server and do some
interactions. The first HTTP request will be longer than others due to
the 3-way hand shake.
(You are referring to
<news:mc******************@newssvr25.news.prodigy .net>;please continue the
thread next time.)

You got it all wrong. It is not the TCP handshake to establish the
connection that *can* make the first transmission slower.

Well, then what makes the first transmission longer? I'm thinking that
it takes another RTT to establish the connection for the first HTTP
request. In my situation, RTT is about 170ms, which is negligible.
The bandwidth allocated for you by statistical multiplexing is shaped
according to your previous network usage. If, and only if, that feature is
implemented along your network path, the first connection is significantly
slower because you have not used that path as much before. That has nothing
to do with the time the TCP handshake takes to establish one connection.

Please trim your quotes:
http://www.jibbering.com/faq/faq_notes/clj_posts.html
PointedEars
--
"Use any version of Microsoft Frontpage to create your site. (This won't
prevent people from viewing your source, but no one will want to steal it.)"
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
Nov 18 '07 #6

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

Similar topics

0
by: microsoft | last post by:
Hi People, when I try to modify an active directory user programatically, I receive the following exception: The server is unwilling to process the request Reading the microsoft web site, I...
10
by: huzz | last post by:
I have web application that quaries the Active Directory to get user details.. everything works fine but someday I'll get System.Runtime.InteropServices.COMExection and if I restart the client...
3
by: Wojciech Halicki-Piszko | last post by:
How to know if connection is active after telnetlib.Telnet.open(host,port)?
13
by: Javier Gomez | last post by:
Is it posible to change by code (in a form) the active .mdw by another one ? When I open the DB I have the system.mdw active after some procesess I need to change to another secure.mdw and make...
2
by: caroh | last post by:
Can anyone see whats wrong with this code: The connections are remaining live in the database: and causing "Timeout expired. The timeout period elapsed prior to obtaining a connection from the...
2
by: Venkata Narayana | last post by:
Hi, You all may be knowing that Connection.isClosed() does not tells us if the underying DB connection is active or not; it only checks if Connection.close() had been previously called or not....
2
by: jason.m.ho | last post by:
Hello! I am trying to build an ajax chat system. Currently I have it so that when you chat, you upload your message to the database, and each client is polling that database to see if he/she has...
1
by: duraisridhar | last post by:
Hi All, My active connection created by my application from windows 2000 to Windows 2003 (or any linux machine) get closed as it receives WSAENOBUFS error . While I googled , I come to know that...
11
by: atlaste | last post by:
Hi, In an attempt to create a full-blown webcrawler I've found myself writing a wrapper around the Socket class in an attempt to make it completely async, supporting timeouts and some scheduling...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.