note 123868 added to gearmanclient.addserver
| From: | michael at butlerpc dot net | Date: | Tue, 21 May 2019 17:23:08 +0000 |
| Subject: | note 123868 added to gearmanclient.addserver | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-211097@lists.php.net to get a copy of this message | ||
Prior to version 2.0.5, addServer DOES perform socket I/O indirectly because it calls
set_server_option internally for an exception handler. This means if the server is unreachable you
will get a GearmanException thrown at this point, and you may want to catch and handle it in your
application.
<?php
$client->addServer('127.0.0.1', 4321); // does attempt a socket connection!
?>
Starting with version 2.0.5 of the extension, a third boolean argument (after $port) may be passed
false in order to prevent this from happening.
<?php
$client->addServer('127.0.0.1', 4321, false); // no socket i/o happens here
?>
----
Server IP: 208.43.231.9
Probable Submitter: 82.199.157.34 (proxied: 184.165.3.172)
----
Manual Page -- http://php.net/manual/en/gearmanclient.addserver.php
Edit -- https://master.php.net/note/edit/123868
Del: integrated -- https://master.php.net/note/delete/123868/integrated
Del: useless -- https://master.php.net/note/delete/123868/useless
Del: bad code -- https://master.php.net/note/delete/123868/bad+code
Del: spam -- https://master.php.net/note/delete/123868/spam
Del: non-english -- https://master.php.net/note/delete/123868/non-english
Del: in docs -- https://master.php.net/note/delete/123868/in+docs
Del: other reasons-- https://master.php.net/note/delete/123868
Reject -- https://master.php.net/note/reject/123868
Search -- https://master.php.net/manage/user-notes.php