Re: Global structures in extension

From: Date: Tue, 03 Jun 2008 07:32:43 +0000
Subject: Re: Global structures in extension
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-38091@lists.php.net to get a copy of this message
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. But I guess the NetInitialize() function might be called once per process. 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. -- Wbr, Antony Dovgal

« previous php.internals (#38091) next »