diff --git a/src/Client/SocketMode.php b/src/Client/SocketMode.php index 5282b0b..dacb797 100644 --- a/src/Client/SocketMode.php +++ b/src/Client/SocketMode.php @@ -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'],