hi all,
i m using WML - PHP coding for my client- server program.
In my code, there are five files:

In index.wml, i m calling first.php and opening a socket, writing some data in that socket, and reading some data from that socket then sending the resultant wml file to the client which in turn calls second.php. In this file at server, i m doing the same thing, opening the socket, writing that socket, reading that socket formatting the resultant wml file and sending it back to the client, which in turn calls third.php and in the same fashion it is calling fourth.php.

In each php file except fourth.php, i m opening a socket, writing it, reading it. and it is working absoulty fine. But the problem comes when i open the socket in first.php and want to persist the connection so that it can be used in second.php then in third.php and then in fourth.php without closing the socket.

I m trying to open the socket in first.php using pfsockopen(), writing it using fwrite(), and reading it using fread().

If i open the socket in first.php and shift to other files, socket is close and i ve to open the socket again which i dont want. i want to open the socket only in first.php and use it in first.php, second.php,third.php,fourth.php and close it in fourth.php.

1. how to persist the socket connection in different php files?
2. Is there any method to transfer file descriptor from one php file to another file such that the socket can be used again and again in different files without closing it?
3. Is there any method to search the opened socket and use it?
4. Is there any other solution to this problem?

looking for help,
Thanks in advance,