I'm looking into doing persistent socket connections with PHP to a Java based application.

I know I can do it with pfsockopen, however looking on the PHP docs some of the comments suggest it might not be actually acting quite how i might expect.

Does anybody have any experience with this? or any advice?

When the page runs, does pfsockopen return the current connection if there is one and open another one if there isn't one already?

The logic behind persistent connections and a language like PHP confuses me, since its stateless etc.

    So are socket connections ever really persistent? how do i retrieve it over multiple pages?

      From my limited understanding of them, it looks to me like it would be pretty difficult to depend on successive calls to a PHP script on a typical web server configuration to ever reconnect to such a persistent connection. But don't bet the house and farm on that comment, as I've not worked with them myself.

        Write a Reply...