6 Replies Latest reply on Jul 13, 2011 7:00 PM by pgmjsd

    Howto do server push with seam2

    thindenberg

      Hello,


      I plan to write a simple online-game, where we would like to notify our clients when events on the server-side occur.
      Does Seam already provide support for server push? If not, what would be the best way to start with?


      I already had a look at seam-remoting, but I guess its not exactly what i am looknig for.


      - Thindy

        • 1. Re: Howto do server push with seam2
          tausuahmed

          Hi,


          Try Icefaces server push technology.


          Regards,
          Tauseef

          • 2. Re: Howto do server push with seam2
            jkaijans

            Seam includes Richfaces, which supports push:


            http://docs.jboss.org/richfaces/latest33X/en/devguide/html/a4jpush.html

            • 3. Re: Howto do server push with seam2
              jkaijans

              http://docs.jboss.org/richfaces/latest33X/en/devguide/html/a4jpush.html

              • 4. Re: Howto do server push with seam2
                gebuh

                Jukka Kaijansinkko wrote on May 23, 2011 01:54:


                http://docs.jboss.org/richfaces/latest33X/en/devguide/html/a4jpush.html


                This doesn't really appear to be a real push from the server.  I'm not sure exactly what the OP is looking for, but I'd like to push events to users without them having to ask for it - I'm looking for a way to let my users know that the server will be shut down soon.  From the documentation ajax push looks like a limited poll - checks for events.
                It uses less resources, but still polls the server.

                • 5. Re: Howto do server push with seam2
                  pgmjsd

                  beth boose wrote on Jul 13, 2011 11:12:



                  Jukka Kaijansinkko wrote on May 23, 2011 01:54:


                  http://docs.jboss.org/richfaces/latest33X/en/devguide/html/a4jpush.html


                  This doesn't really appear to be a real push from the server.  I'm not sure exactly what the OP is looking for, but I'd like to push events to users without them having to ask for it - I'm looking for a way to let my users know that the server will be shut down soon.  From the documentation ajax push looks like a limited poll - checks for events.
                  It uses less resources, but still polls the server.


                  HTTP doesn't support true 'push', so you must poll (pull push adapter) to simulate it.  Additionally, the JavaScript engine in the browser is single threaded, so you have to do some cooperative multi-tasking to get interactivity.


                  Once you get all that down, you can do some pretty cool 'push' stuff with an ordinary browser (even though it's not really doing push underneath).   I should know.  The app we built handles over 5 million polling requests per day. :)



                  Your other choice is to not use HTTP, or to use a multi-threaded client (e.g. Java or something) and trick HTTP KeepAlive into letting you push stuff to the browser at the appropriate times.   You're still polling, but it's just for the initial socket connect.

                  • 6. Re: Howto do server push with seam2
                    pgmjsd

                    BTW, we use Seam 2 - Seam Remoting combined with our own JavaScript loop to do the polling and the cooperative multi-tasking.   We have a requirement to know when the user's browser gets disconnected or closed and handle that on the server side.