bind failure in connect() remains unreported
bwoebi opened this issue · comments
Bob Weinand commented
<?php
include "vendor/autoload.php";
Amp\Socket\connect("127.0.0.1:80", (new Amp\Socket\ConnectContext)->withBindto("127.0.0.2"));
This will silently connect from 127.0.0.1 instead of failing with the following warning: Warning: Failed to bind to '127.0.0.2:0', system said: Can't assign requested address
.
(On a mac 127.0.0.1 is the only available local IP, and not the full 127.0.0.0/8 - hence I had this happen, to reproduce on linux use a different IP alltogether.)
This seems to be completely silenced by the set_error_handler(static fn () => true);
.