Re: persistent TCP connection over page reloads ?
- From: Thomas 'PointedEars' Lahn <PointedEars@xxxxxx>
- Date: Fri, 18 Apr 2008 11:11:50 +0200
mel wrote:
[...] Thomas 'PointedEars' Lahn [...] wrote:
mel wrote:
Yes, it can. Reading it back is the difficult thing.A XmlHttpRequest can't.but those storages only hold strings.What else would you want to store? Even an image can be represented by a
sequence of characters.
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 think it would be possible to restore the status and the data already
received, but the request would have to be a new one.
I want to store a XMLHttpRequest object and not destruct it over pageTough luck. You will need a persistent container object for your persistent
reloads.
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).
Without serialization, it is the only solution with browser scripting.
Actually, it doesn't have to be a XMLHttpRequest, that is why I didn'tI beg your pardon?
mentioned HTTP.
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.
You mean an HTML document.
If a page gets reloaded, is there a way to keep a connection with the
server live ?
The connection: yes (see HTTP/1.1). The global execution context: no.
It could be a ftp session, or any other kind of connection through js,ISTM you don't want to use browser scripting.
java applets, flash or whatever other technology you want to use (as
Stevo pointed out).
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.
Again, then you should ask in the appropriate newsgroup. Maybe not
comp.lang.misc but comp.infosystems.www.authoring.misc as this is more
about technique than language.
I guess I am not in the wrong newsgroup, since this questions if
javascript is capable of doing something or not.
"javascript" is capable of a great many things that are not particularly
on-topic here because "javascript" is primarily used as an interfacing
programming language.
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.
Tough luck.
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)
I think it could work, but it would not be very efficient.
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)
It cannot work because setTimeout() is a method of a Window object that is
referred to be the `window' property of the Global Object of the global
execution context. That context is destructed on navigation.
3) keeping the connection live on the browser's visited page, and
access it through the current page (this doesn't work either)
Same reason.
4) putting all my site inside a frame, and using a 0size frame with
the object (that works, but makes everything ugly)
Same reason. No navigation in that frame, no destruction of the global
execution context associated with it.
5) opening a popup window and keeping the object there (that works
too, but oppup blockers block me)
See above.
[...]
Please trim your quotes.
Which part of that did you not get?
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>
.
- 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
- Re: persistent TCP connection over page reloads ?
- From: mel
- persistent TCP connection over page reloads ?
- Prev by Date: Re: “OpenOffice.org” free Office suite for Microsoft Windows, Linux, Solaris, BSD, OpenVMS, OS/2 or IRIX
- Next by Date: Re: logic and disabling onclicks?
- Previous by thread: Re: persistent TCP connection over page reloads ?
- Next by thread: Re: persistent TCP connection over page reloads ?
- Index(es):
Relevant Pages
|