For Programmers: Free Programming Magazines  


Home > Archive > PHP Programming > September 2004 > Passing sockets through pages









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Passing sockets through pages
Dan

2004-09-28, 8:57 am

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

2004-09-28, 4:00 pm

Dan wrote:

> 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.
>


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.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com