Skip to content

bind failure in connect() remains unreported #108

@bwoebi

Description

@bwoebi
<?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);.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions