I've developed a PHP5 client extension for a server application i wrote, and so far it's working quite well, but it doesn't support persistent connections yet. Since this is something i want to implement before releasing the first stable version, i was searching for documentation about persistance and found the persistent allocation routines ( pemalloc, pecalloc, etc ). What i can't understand is how to retrieve a persistently allocated object upon new requests, i mean, let's say that the persistent id of a connection is:
<hostname>:<port>:<timeout>
How do i save ( or check if it was already created ) the connection object ( which is a C structure, not a zval or anything strictly PHP related ) ? How can i retrieve it later given its id ?
PS: I know about PHP persistent streams ( i've studied the pfsockopen C sources ), but i use a C client library so i can't access the socket directly or modify the C client library to use php streams instead of plain sockets.
Thanks.