More debugging for connects and disconnects
This commit is contained in:
parent
03c6a5c426
commit
edfb802805
@ -7,6 +7,7 @@ use Devristo\Phpws\Messaging\WebSocketMessageInterface;
|
||||
use Evenement\EventEmitterTrait;
|
||||
use GuzzleHttp\ClientInterface;
|
||||
use Illuminate\Http\Client\ConnectionException;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use React\EventLoop\LoopInterface;
|
||||
use React\Promise\Deferred;
|
||||
@ -103,10 +104,15 @@ class SocketMode extends API
|
||||
|
||||
// then wait for the connection to be ready.
|
||||
->then(function () use ($deferred) {
|
||||
$this->once('hello', function () use ($deferred) {
|
||||
$this->once('hello', function ($data) use ($deferred) {
|
||||
Log::debug(sprintf('%s:- hello [#%d]...',self::LOGKEY,Arr::get($data->getData(),'num_connections')),['m'=>__METHOD__,'d'=>$data]);
|
||||
$deferred->resolve();
|
||||
});
|
||||
|
||||
$this->once('disconnect', function ($data) use ($deferred) {
|
||||
Log::debug(sprintf('%s:- disconnect ...',self::LOGKEY),['m'=>__METHOD__,'d'=>$data]);
|
||||
});
|
||||
|
||||
$this->once('error', function ($data) use ($deferred) {
|
||||
$deferred->reject(new ConnectionException(
|
||||
'Could not connect to WebSocket: '.$data['error']['msg'],
|
||||
|
Loading…
Reference in New Issue
Block a user