Re: session related connection handling/cvs/mem
| From: | derick@php.net | Date: | Thu, 27 Jun 2002 20:41:40 +0000 |
| Subject: | Re: session related connection handling/cvs/mem | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-85641@lists.php.net to get a copy of this message | ||
On Thu, 27 Jun 2002, Ron Lange wrote:
> Hi,
> 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.
You need to serialize that c data struct somehow which you can load when
the session 'wakes up' again. I imagine that might not be possible for
sockets, so you need to resort to some deamon for that to keep the sockets
survive after a request ends. Now there is a solution for this already:
SRM. (For more information see www.vl-srm.net, or write to
srm@lists.vl-srm.net). I would be happy to answer every question you have
about it.
>
> 2. How I can determine which session is no longer used and can be freed?
The garbage collector is called according to your php.ini settings. If you
provide a GC from your session handler, you can then close your 'sessions'
yourself.
>
> 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???
(from your extension source directory):
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?
No, you don't need too, but if you use them they show memory leakage when
the script ends, and it might be slightly faster.
Derick
---------------------------------------------------------------------------
Did I help you? http://www.derickrethans.nl/link.php?url=giftlist
Frequent ranting: http://www.derickrethans.nl/
---------------------------------------------------------------------------
PHP: Scripting the Web - derick@php.net
All your branches are belong to me!
SRM: Script Running Machine - www.vl-srm.net
---------------------------------------------------------------------------