Re: persistent TCP connection over page reloads ?



mel wrote:
[...] Thomas 'PointedEars' Lahn [...] wrote:
mel wrote:
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 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 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).

Without serialization, it is the only solution with browser scripting.

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.

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,
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.

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>
.



Relevant Pages

  • Re: Need help with time stretching using STFT
    ... data from the input buffer, applies a linear window function, ... frequency of the sinusoid that ... then knowing what the frequency is, if the previous frame has a bump ... adjust is the value of that common time displacement. ...
    (comp.dsp)
  • RE: multiple modal dialogs
    ... There are two different ways of showing dialogs: ... Modal dialog (and any window for that matter) runs on the top of all ... While modal dialog relies on own message loop modeless relies on application ... that these frame windows can have there own modal ...
    (microsoft.public.vc.mfc)
  • TCP/IP connections problems on Win2003 Entreprise Server
    ... Time since reference or first frame: ... Flags: 0x04 (Don't Fragment) ... Header checksum: 0x16eb ... Window scale: 0 ...
    (microsoft.public.windows.server.networking)
  • Re: IE not loading script?
    ... I was not referring to the official "Reserved Words"; ... Object only for the global execution context. ... have a host-defined property named `window' that refers to the Global Object ...
    (comp.lang.javascript)
  • Re: [9fans] acme
    ... or so) versions of Acme. ... that frame in case it is visible, ... both tagline, and regular frame. ... but there are window layout problems. ...
    (comp.os.plan9)