FW: Pushing Files.

"Adam Rifkin" <[email protected]>
Newsgroups gmane.comp.web.mod-pubsub.devel
Message-ID <[email protected]>
Good answer below by Just van den Broecke on pushing files using Pushlets --
we'd pretty much give the same answer for mod_pubsub.

   -- Adam


P.S. -- There have been some more commits to CVS in the past few days,
in kn_docs, kn_apps/javascript/, php_pubsub, c_pubsub, and kn_tools --
feel free to do an update.  I'll probably put together a v0.94 mod_pubsub
tarball soon; I'm in the middle of updating "verbose" mode on pubsub.py.




-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Wednesday, May 07, 2003 8:13 AM
To: [email protected]
Subject: [pushlet] Digest Number 207

There are 3 messages in this issue.

Topics in this digest:

      1. Pushing Files Possible?
           From: "Bryan S. Martinez" <[email protected]>
      2. Re: Pushing Files Possible?
           From: Just van den Broecke <[email protected]>
      3. Issues between HTTP 1.1 proxies and push?
           From: "camlin44" <[email protected]>


________________________________________________________________________
________________________________________________________________________

Message: 1
   Date: Wed, 7 May 2003 12:24:37 +0800
   From: "	Bryan S. Martinez" <[email protected]>
Subject: Pushing Files Possible?

is pushing files possible with the pushlet?


________________________________________________________________________
________________________________________________________________________

Message: 2
   Date: Wed, 07 May 2003 10:09:44 +0200
   From: Just van den Broecke <[email protected]>
Subject: Re: Pushing Files Possible?

The current event mechanism allows only "flat" messages (a list of 
name/value pair strings, basically a java.util.Proeprties object). It 
really depends on your application what you want to achieve, ranging from:

- pushing fresh HTML content into a browser window, to
- pushing arbitrary files to arbitrary (non-browser) clients

There are roughly two options possible in the current design:
- you can always push the _name_ (URL) of a file such that clients can 
download from the URL (this way you also get the right MIME type etc).
- encode your file data into an event attribute value:
* HTML: URL encoding (java.net.URLEncoder and JS reverse decoding).
* binary Base64 encoding.

As said it really depends on your application and in particular the 
client type you want to use.

In a next version I will make the pushlet Event more general such that 
arbitrary content can be sent.

Just


Bryan S. Martinez wrote:
> is pushing files possible with the pushlet?

-- 

--Just

Just van den Broecke          [email protected]
Just Objects B.V.             tel. +31 65 4268627
The Netherlands               http://www.justobjects.nl








________________________________________________________________________
________________________________________________________________________

Message: 3
   Date: Wed, 07 May 2003 13:39:05 -0000
   From: "camlin44" <[email protected]>
Subject: Issues between HTTP 1.1 proxies and push?

I have a question about pushlets and "HTTP push" in general:

I agree that it works quite fine with HTTP 1.0 but I really have the 
feeling that it would cause multiple issues with HTTP 1.1. 

I am especially thinking of HTTP 1.1 proxies. When a client connects 
to a server through a 1.1 proxy, then when it disconnects from the 
proxy, usually the proxy will keep its connection with the server 
until the server disconnects (See note *1) or the connection times 
out. So, depending how the proxy evaluates the connection timeout, 
the server could quickly be running out of processing threads 
because they are all busy "processing" gone clients!!

Troublesome cases are: 
- proxy reset the timeout each time the server send something 
ignoring the fact that no client is listening (silly but I have seen 
2 HTTP 1.1 proxies with this behaviour on a sample of 3! But I agree 
I need to increase the size of my sample).
- each time a different client attempts to access the same pushlet 
via the same proxy. In this particular case issues would happen 
especially if the proxy try to pipeline the new incoming request 
onto the current connection using HTTP 1.1 pipelining (But this 
could be helped by adding the header "Connection: close" on the 
server side). So subsequent requests would never be processed and/or 
the server would quickly be starved of connection and/or threads 
depending on the proxy connection allocation strategie...

Or I am missing something???

Gilles.

Note *1: Which it will never do on its own in the case of pushlets 
as it always waits for the clients (here the proxy) to disconnect 
first. And this is in the *optimistic* case where it even manages to 
detect this situation because an IOException was thrown or the 
PrintWriter error flag set... See "Knowing when no one's listening" 
in chapter 5.7 of the Java Servlet Programming book by Jason Hunter.



------------------------------------------------------------------------
To Post a message, send it to:   [email protected]
To Unsubscribe, send a blank message to: [email protected]
------------------------------------------------------------------------


-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.