Re: persistent TCP connection over page reloads ?
- From: mel <samuelgoto@xxxxxxxxx>
- Date: Wed, 16 Apr 2008 16:39:19 -0700 (PDT)
On Apr 16, 1:58 am, Thomas 'PointedEars' Lahn <PointedE...@xxxxxx>
wrote:
mel wrote:
On Apr 15, 2:51 pm, Thomas 'PointedEars' Lahn <PointedE...@xxxxxx>
wrote:
mel wrote:
I need a persistent TCP connection with my web server over pageNo, you don't. Besides, persistent *HTTP* connections (which is what you
reloads.
mean) have to be supported by both client and server, and they won't help
you here. Whether the HTTP connection is persistent or not, the current
wait. aren't HTTP connections built on top of TCP ?
Yes, they are. But that does not matter.
global execution context of the script engine is destructed when another
resource is being navigated to.
window.name & globalStorage & userData aren't destructed
As for window.name, there is insufficient proof for that.
This means that, even if the user goes to a different page (inChances are that it is kept alive already, as persistent connections are the
my domain), I want to keep a TCP connection live.
HTTP/1.1 default. You don't seem to know what TCP is.
You don't seem to understand my question.
You don't seem to have asked the right one.
I know I can do something similar with globalStorage in FF,Or simply cookies, supported by all scriptable UAs through the same mechanism.
window.name & userData on IE,
cookies go back to the web server.
Cookies are stored client-side. They are submitted to the Web server only
on request.
i don't want them to. cookies only store strings, which doesn't work for
me either (unless I can serialize a xmlhttprequest).
but those storages only hold strings.What else would you want to store? Even an image can be represented by a
sequence of characters.
A XmlHttpRequest can't.
Yes, it can. Reading it back is the difficult thing.
not difficult, impossible. serializing it would make it a string, and
when the object reference is lot, it will close the http connection.
deserializing it wouldn't get the object to its original state.
or am I wrong ?
I want to store a XMLHttpRequest object and not destruct it over page
reloads.
Tough luck. You will need a persistent container object for your persistent
execution context, say a frame or another window.
that is one solution (doing everything inside a frame or opening
another window), but (1) i don't want to put my hole website inside a
frame, and (2) I am trying to avoid popups (because no one likes
popups, and most of the people disables them).
Actually, it doesn't have to be a XMLHttpRequest, that is why I didn't
mentioned HTTP.
I beg your pardon?
As far as the connection is alive over page reloads, it works for me.
That depends on what you call a "page".
A page, contained inside a <html> tag. If a page gets reloaded, is
there a way to keep a connection with the server live ?
It could be a ftp session, or any other kind of connection through js,
java applets, flash or whatever other technology you want to use (as
Stevo pointed out).
ISTM you don't want to use browser scripting.
I do. I woulde definitely prefer to use js.
But if js can't do the job, then I am flexible enough to go to a
different approach.
And, AFAIK, I can't serialize a TCP connection (could be throughBut you can serialize objects.
XmlHttpRequest, etc).
I wonder if anyone knows if this is possible at all.That depends on what you are *really* up to.
maybe you didn't understand what I need.
Maybe you have not explained it properly.
[...]
I want to stream data from the server to the client (I guess this is
called push, reversed ajax, or watever), but once the streaming starts
my server can't loose the connection with the client (the browser).
any ideas ?
You have explained what you want but not why. ISTM you are on the wrong
track, and in the wrong newsgroup anyway.
I guess I am not in the wrong newsgroup, since this questions if
javascript is capable of doing something or not.
The why is here:
I have a server, and it streams data to a particular user. It is
important for me to keep the connection with the user live, even if
the user goes to a different page (inside my domain). I am not using
frames, and I don't want to popup another window to keep this
connection live.
Couple of things I tried:
1) serializing/deserializing the XMLhttpRequest & storing it on the
globalStorage & userData (this is very unlikely to work, because it is
kind of absurd)
2) setTimeout(function() {return obj}, 5 seconds ) on unload() and
catching it back on load() (this is very unlikely to work, because it
is absurd)
3) keeping the connection live on the browser's visited page, and
access it through the current page (this doesn't work either)
4) putting all my site inside a frame, and using a 0size frame with
the object (that works, but makes everything ugly)
5) opening a popup window and keeping the object there (that works
too, but oppup blockers block me)
those are all kind of absurd, but I had to try.
Please trim your quotes.
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>
.
- Follow-Ups:
- Re: persistent TCP connection over page reloads ?
- From: Thomas 'PointedEars' Lahn
- Re: persistent TCP connection over page reloads ?
- References:
- persistent TCP connection over page reloads ?
- From: mel
- Re: persistent TCP connection over page reloads ?
- From: Thomas 'PointedEars' Lahn
- Re: persistent TCP connection over page reloads ?
- From: mel
- Re: persistent TCP connection over page reloads ?
- From: Thomas 'PointedEars' Lahn
- persistent TCP connection over page reloads ?
- Prev by Date: Re: Recursive object literals in Javascript ?
- Next by Date: Re: persistent TCP connection over page reloads ?
- Previous by thread: Re: persistent TCP connection over page reloads ?
- Next by thread: Re: persistent TCP connection over page reloads ?
- Index(es):
Relevant Pages
|
Loading