Re: Net_GSQ API Question
| From: | David Grant | Date: | Thu, 22 Apr 2004 13:02:01 +0000 |
| Subject: | Re: Net_GSQ API Question | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-28260@lists.php.net to get a copy of this message | ||
Aidan,
Aidan Lister wrote:
If a connection to a server fails, there is a 1000ms delay in the socket before it's killed (this is minimum). That happening 4 times is a problem.This would only occur if you were creating a socket four times though. Why not create the socket on instantiation, then test the socket for signs of life before you throw something down it.
You'll be returning in an array, but the design choice is up to you.I would've thought an array to be a more appropriate argument to the query method than multiple length arguments.Yeh, It could be done either way, I think the overloading is nicer.
How about collecting all the information the implementor requires, then ask them to call another method to start the retrieval. For example: $server = new Net_GamesServerQuery($ip, $port, $game); $server->requestFoo(); $server->requestBar(); $server->requestBaz(); $results = $server->sendQuery();Personally I would stick with the seperate methods, as it leaves the API obvious.Requests can't be concatenated, this is a big problem if you're querying 10 servers. It would be 4 times slower (with the gamespy protocol) sending each request seperatly.
That's a fair point! Regards, DavidIf someone wants to alter it, then the license allows them to do so.Well sure, but we're aiming to release top quality stuff, not quality stuff that can be improved :)