Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old December 21st, 2005, 03:25 AM
Susan Baker
Guest
 
Posts: n/a
Default Server push using PHP ?

Is it possible to "push" data from a server to a client, using PHP
server side scripting?. An example script will be very useful.

Thanks

  #2  
Old December 21st, 2005, 10:15 AM
Michael
Guest
 
Posts: n/a
Default Re: Server push using PHP ?

Please explain in greater detail, with an example explanation of what
you want to do.

  #3  
Old December 21st, 2005, 10:35 AM
tony@marston-home.demon.co.uk
Guest
 
Posts: n/a
Default Re: Server push using PHP ?

The HTTP protocol works on the request-response principle which means
that the server can only generate a response following a request from
the client. This means that the server *cannot* send a response to the
client without having received a request in the first place. This is
not a PHP issue, it is an HTTP issue.

  #4  
Old December 21st, 2005, 11:05 AM
somaboy mx
Guest
 
Posts: n/a
Default Re: Server push using PHP ?

"Susan Baker" <sbaker@no.spam.net> wrote ...[color=blue]
> Is it possible to "push" data from a server to a client, using PHP server
> side scripting?. An example script will be very useful.[/color]

If I understand you correctly you need a type of server app that a chat or
messaging client can connect to on a specific port, and once the connection
is established your server needs to be able to pump data down the pipe
without client requests (ie. passive client). Usually these kind of apps are
separate processes that run continuously on a web server, often written in
Java, Python etc. PHP scripts normally run once upon request, output
something and exit. But you could write a PHP script that executes
continually in an endless loop and have it act as a socket server, as
demonstrated in this tutorial:
http://www.zend.com/pecl/tutorials/sockets.php This is more of a hack than a
solution though.

The client can't be a regular web browser as it can only receive data on
request, but you can use the Flash player, because it has an XML socket API.

..soma


  #5  
Old December 21st, 2005, 01:25 PM
Susan Baker
Guest
 
Posts: n/a
Default Re: Server push using PHP ?



somaboy mx wrote:
[color=blue]
> "Susan Baker" <sbaker@no.spam.net> wrote ...
>[color=green]
>>Is it possible to "push" data from a server to a client, using PHP server
>>side scripting?. An example script will be very useful.[/color]
>
>
> If I understand you correctly you need a type of server app that a chat or
> messaging client can connect to on a specific port, and once the connection
> is established your server needs to be able to pump data down the pipe
> without client requests (ie. passive client). Usually these kind of apps are
> separate processes that run continuously on a web server, often written in
> Java, Python etc. PHP scripts normally run once upon request, output
> something and exit. But you could write a PHP script that executes
> continually in an endless loop and have it act as a socket server, as
> demonstrated in this tutorial:
> http://www.zend.com/pecl/tutorials/sockets.php This is more of a hack than a
> solution though.
>
> The client can't be a regular web browser as it can only receive data on
> request, but you can use the Flash player, because it has an XML socket API.
>
> .soma
>
>[/color]

Tks. Looks like what I'm looking for

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles