Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38093 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92477 invoked from network); 3 Jun 2008 12:01:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jun 2008 12:01:22 -0000 X-Host-Fingerprint: 89.79.39.63 chello089079039063.chello.pl Received: from [89.79.39.63] ([89.79.39.63:12596] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 87/93-58719-38235484 for ; Tue, 03 Jun 2008 08:01:12 -0400 Message-ID: <87.93.58719.38235484@pb1.pair.com> To: internals@lists.php.net Date: Tue, 03 Jun 2008 14:01:03 +0200 User-Agent: Thunderbird 2.0.0.14 (X11/20080502) MIME-Version: 1.0 References: <4843CE26.40902@daylessday.org> <6E.AD.26717.18424484@pb1.pair.com> <4844F39B.6040508@daylessday.org> In-Reply-To: <4844F39B.6040508@daylessday.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 89.79.39.63 Subject: Re: [PHP-DEV] Global structures in extension From: adam@klobukowski.pl (Adam Klobukowski) Antony Dovgal pisze: > On 02.06.2008 20:49, Adam Klobukowski wrote: >> HYAMIAGENT agent; >> >> PHP_MINIT_FUNCTION(gra) >> { >> yamiNetInitialize(); >> >> yamiCreateAgent(&agent, 0, NULL); >> >> yamiAgentDomainRegister(agent, SERVER_NAME, SERVER_ADDRES, >> SERVER_PORT, 2); >> >> return SUCCESS; >> } >> /* }}} */ > > Well, this is clearly wrong as the agent object has to be created by > your functions each time - in the same way as MySQL are created each > time you > connect to a MySQL server. Thats is not true. Agent is multi threaded internally and required once per instance. For example, in server, one agent is responsible for all communication for multiple objects (services). > But I guess the NetInitialize() function might be called once per process. That's true. > Also you didn't mention whether you're developing on Windows or not - > there seem to be quite a noticeable difference in the way that library > works. I'm developing for Linux. Adam Klobukowski