Re: Question about socket ext. file descriptors

From: Date: Thu, 29 Mar 2001 09:08:23 +0000
Subject: Re: Question about socket ext. file descriptors
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-50192@lists.php.net to get a copy of this message
Why do you need to rely on such behavior? Are you trying to do something naught? :) I think in general it's not a good idea to rely on the value and type of resources (even though this is an integer). I'm not quite sure why it returns integers and not resources. Looks like a bad thing to me as the extension can easily have file descriptor leaks. The socket should really be saved either in the resource list or in a socket extension local list in order to be able to cleanup at shutdown. I think in the meanwhile you should assume it might change to using resources. Andi At 10:56 PM 3/28/2001 -0800, Lars Torben Wilson wrote:
At present, the sockets extension uses integers as file descriptors (e.g. socket() return value). At first I thought maybe they should have been resources until I tried writing some socket code, when I realized that it's easier under many circumstances for them to be ints. Is this going to be behaviour that can be relied upon? Thanks, Torben -- +----------------------------------------------------------------+
|Torben Wilson <torben@php.net>                    Adcore Finland|
|http://www.coastnet.com/~torben            http://www.adcore.com|
|Ph: 1.604.709.0506                             torben@adcore.com|
+----------------------------------------------------------------+ -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net


« previous php.dev (#50192) next »