Skip to content

Return Connection object which exposes remote address #44

Closed
@clue

Description

@clue

Each connector currently resolves with a Stream instance from the react/stream component. We should look into resolving with a Connection instance (which likely extends the Stream class) which should expose the remote address like this:

$connector->create('google.com', 80)->then(function (Connection $conn) {
    echo 'connected to ' . $conn->getRemoteAddress();
    $conn->close();
});

Note that the react/socket component already has a similar class (https://github.com/reactphp/socket/blob/master/src/Connection.php) which represents the server-side end of a connection.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions