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.