Closed
Description
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.