Skip to content

Return Connection object which exposes remote address #44

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions