Can Python work for me?

Alex Martelli aleax at aleax.it
Fri Feb 21 15:11:44 EST 2003


Steven Taschuk wrote:

> Quoth Alex Martelli:
>> Adam Rumpke wrote:
>   [...]
>> > FOR EXAMPLE: If I want to print and the printer is jammed a user at
>> > home will need to know the printer is not working. I would like the
>> > system to send a message via
>> > the browser with out the browser constantly reloading. Could Python do
>> > this?
>> 
>> It doesn't matter much what language you use on the server-side
>> for this: you want to do something outside the parameters of the
>> HTTP protocol, which is based on request/response, i.e. have the
>> server "initiate" something [...]
> 
> Well, you could run a special-purpose HTTP server on the client
> machine, and have the print server send HTTP POSTs to that server
> to inform it of job status, etc..  That's "inside" HTTP, in a
> certain sense.

But the browser (specified by the OP) would STILL have to be
constantly reloading: even though the constant reloading would
be from a special-purpose server rather than from a general
one, it still would violate the specs.

> (Not to dispute your point that a vanilla browser and server can't
> do this without polling.)

It doesn't matter if the server is mocha fudge.  If by "the browser"
the OP (as presumably he does) means a "vanilla browser", i.e. one
that implements HTTP and a few other traditional protocols such as
FTP, the server cannot "send a message via the browser" without the
browser periodically polling.  "Push" (server taking the initiative
of sending a message) is not part of today's HTTP.


Alex





More information about the Python-list mailing list