Passing sockets through pages

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dan

    #1

    Passing sockets through pages

    Hello

    Has anybody tried to open a socket to connect to a server on page a.php
    and then passing it throung a session variable and getting it back at
    page b.php and use it there.

    Ive tried that and it doesnt work, the sockets looses the connection.
    Ive tried algo to serialize it one page and un serialize it int the
    next one and still doesnt work.

    Any ideas?

    Dan

  • Colin McKinnon

    #2
    Re: Passing sockets through pages

    Dan wrote:
    [color=blue]
    > Hello
    >
    > Has anybody tried to open a socket to connect to a server on page a.php
    > and then passing it throung a session variable and getting it back at
    > page b.php and use it there.
    >
    > Ive tried that and it doesnt work, the sockets looses the connection.
    > Ive tried algo to serialize it one page and un serialize it int the
    > next one and still doesnt work.
    >[/color]

    It won't work - PHP closes all file handles on exit. You could setup some
    background process to handle the socket connection (but then you'll need
    some method of connecting to the background process - but there may be
    benefits in implementing a lightweight protocol to the backend).

    C.

    Comment

    Working...