<?php $peer = new Promise(function ($resolve, $reject) use ($server) {
$server->on('connection', function (ConnectionInterface $connection) use ($resolve) {
$resolve(stream_context_get_options($connection->stream));
});
});
<?php $peer = new Promise(function ($resolve, $reject) use ($server) {
$server->on('connection', function (ConnectionInterface $connection) use ($resolve) {
$resolve(stream_context_get_options($connection->stream));
});
});
<?php $peer = new Promise(function ($resolve, $reject) use ($socket) {
$socket->on('connection', function (ConnectionInterface $connection) use ($resolve) {
$resolve(stream_context_get_options($connection->stream));
});
});