File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ static async Task Main(string[] args)
4343 socket . OnPing += Socket_OnPing ;
4444 socket . OnPong += Socket_OnPong ;
4545 socket . OnDisconnected += Socket_OnDisconnected ;
46- socket . OnReconnecting += Socket_OnReconnecting ;
46+ socket . OnReconnectAttempt += Socket_OnReconnecting ;
4747
4848 //Console.WriteLine("Press any key to continue");
4949 //Console.ReadLine();
Original file line number Diff line number Diff line change @@ -189,6 +189,8 @@ private void Initialize()
189189 public async Task ConnectAsync ( )
190190 {
191191 Uri wsUri = UrlConverter . HttpToWs ( ServerUri , Options ) ;
192+ _reconnectionDelay = Options . ReconnectionDelay ;
193+
192194 while ( true )
193195 {
194196 try
@@ -197,11 +199,7 @@ public async Task ConnectAsync()
197199 {
198200 break ;
199201 }
200- if ( Attempts == 0 )
201- {
202- _reconnectionDelay = Options . ReconnectionDelay ;
203- }
204- else if ( Attempts > 0 )
202+ if ( Attempts > 0 )
205203 {
206204 OnReconnectAttempt ? . Invoke ( this , Attempts ) ;
207205 }
@@ -512,7 +510,7 @@ private void ConnectedHandler(ConnectionResult result)
512510 Connected = true ;
513511 Disconnected = false ;
514512 OnReconnected ? . Invoke ( this , Attempts ) ;
515- Attempts = 0 ;
513+ Attempts = 1 ;
516514
517515 if ( result . Id != null )
518516 {
You can’t perform that action at this time.
0 commit comments