> I have to build a extension for PHP, which is connecting to a special
> server over tcp/ip. For each session (client-php) a session related set of
> data has to be kept, inclusive the socket descriptors and so on.
>
> 1. How can I keep the relationship of the data and the session? The data
> consists of a c struct.

Write it to disk, shared memory or a Database with the session id as the
key.

> 2. How I can determine which session is no longer used and can be freed?

You determine when you want to garbage collect your sessions.  It is up to
you.  So simply write your own session handler and when a session times
out based on the timeout you configure, clean up everything.

> 3. At the moment my work rests in the cvs tree of our project, and I want
> them to stay there. How I can build the php extension (using php-internal
> build scripts) without great difficulties???

phpize
./configure
make

> 4. Our project uses own memory functions, since the sources will be
> compiled on several different platforms. Do I have to use zend's exxx
> memory functions?

Nope, you don't need to.  You just have to be very careful that you free
everything you allocate.  If you don't use the PHP-supplied emalloc/efree
then there is no memory leak safety net and you are free to shoot yourself
in the foot.

-Rasmus


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to