Server Push

Discussion in 'Python' started by John Bradbury, Jul 3, 2003.

  1. I want to send updates from a long running cgi. I have tried copying perl
    examples of server push and can not get them to work.
    Does anyone have an idiot proof example of a working server push or sending
    output in chunks in Python?
    Thanks
    John Bradbury
    John Bradbury, Jul 3, 2003
    #1
    1. Advertising

  2. John Bradbury pushed the bounds of literature with:

    > I want to send updates from a long running cgi. I have tried copying
    > perl examples of server push and can not get them to work.
    > Does anyone have an idiot proof example of a working server push or
    > sending output in chunks in Python?
    > Thanks
    > John Bradbury
    >
    >
    >


    I'm not sure what you mean by 'server push' but if you want to update a
    web page progressively, you have to make sure that your web server isn't
    buffering. I think IIS does buffer by default.

    You can then send out incremental updates to the page using print from a
    CGI script. Bear in mind though that the web page must suite this type of
    update. Also, some browsers might not display it correctly until they
    have the </html> tag.


    --
    Dale Strickland-Clark
    Riverhall Systems Ltd, www.riverhall.co.uk
    Dale Strickland-Clak, Jul 4, 2003
    #2
    1. Advertising

  3. John Bradbury

    Van Gale Guest

    Irmen de Jong wrote:
    > John Bradbury wrote:
    >
    >> I want to send updates from a long running cgi. I have tried copying
    >> perl
    >> examples of server push and can not get them to work.
    >> Does anyone have an idiot proof example of a working server push or
    >> sending
    >> output in chunks in Python?

    >
    > to work). The other method is just flushing your output and
    > continue to write more data...


    I don't know the details, so this is hearsay, but there's another way
    apparently used by KnowNow (www.knownow.com) to implement a 2-way web
    interface. Each browser page has 3 frames, one of which is hidden and
    is receiving non-ending Javascript from the server (which apparently
    modifies a visible frame as it comes it comes in). This lets them do
    some slick things like auto-completion in web forms.

    (Apologies to John for not providing any actual help with this post :/)

    Van
    Van Gale, Jul 5, 2003
    #3
  4. John Bradbury

    John Taylor Guest

    John,

    You could always write a Java applet. If the applet used something
    like a progress bar, the server-side program could notify the applet
    when to increase the progress bar percentage. Another way to do it,
    would be for the applet to poll the server every few seconds by having
    it make a http connection to a 'quick-running' cgi that would tell the
    applet the status. Based on this result, the progress bar would (or
    would not) be updated.

    You may also be able to write the applet in Jython, too.

    Good luck...let everyone know how you decide to implement your
    solution.
    John Taylor


    "John Bradbury" <john_bradbury@___cableinet.co.uk> wrote in message news:<bea2qv$jiv$>...
    > I have used the Netscape examples and can not get them work. I am using
    > Windows and have tried Omnicron and XITAMI servers. What is frustraing me
    > is that I can achieve the desired result in Delphi by simply using :
    > response.sendresponse;
    > request.writestring('progress line');
    >
    > I was hoping to find similar functionality in Python.
    >
    > John
    >
    >
    > "Irmen de Jong" <> wrote in message
    > news:3f05b7ab$0$49103$4all.nl...
    > > John Bradbury wrote:
    > > > I want to send updates from a long running cgi. I have tried copying

    > perl
    > > > examples of server push and can not get them to work.
    > > > Does anyone have an idiot proof example of a working server push or

    > sending
    > > > output in chunks in Python?

    > >
    > > Check out: http://wp.netscape.com/assist/net_sites/pushpull.html
    > >
    > > There are basically two ways to do this. Either use the
    > > above mentioned "multipart response", which only seems to work on
    > > certain browsers (confirmed on netscape and mozilla, IE doesn't seem
    > > to work). The other method is just flushing your output and
    > > continue to write more data... but this won't allow you to
    > > 'clear the page' in the client's browser (multipart repsonses will).
    > >
    > > --Irmen
    > >
    John Taylor, Jul 7, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DesignerX

    how to do a server push

    DesignerX, Aug 12, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    3,187
    DesignerX
    Aug 12, 2003
  2. Alin Capitanescu

    Server push to client

    Alin Capitanescu, Jan 5, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    4,746
    Steve C. Orr [MVP, MCSD]
    Jan 5, 2004
  3. PyroBrain

    Server Push

    PyroBrain, Jan 22, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    337
    PyroBrain
    Jan 22, 2004
  4. XyZaa
    Replies:
    0
    Views:
    552
    XyZaa
    Jul 19, 2007
  5. samppi
    Replies:
    27
    Views:
    450
    David A. Black
    Dec 5, 2007
Loading...

Share This Page