File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
src/main/java/io/socket/client Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -490,15 +490,22 @@ private void cleanup() {
490490 On .Handle sub ;
491491 while ((sub = this .subs .poll ()) != null ) sub .destroy ();
492492
493+ this .packetBuffer .clear ();
494+ this .encoding = false ;
493495 this .lastPing = null ;
496+
497+ this .decoder .destroy ();
494498 }
495499
496500 /*package*/ void close () {
501+ logger .fine ("disconnect" );
502+ this .skipReconnect = true ;
503+ this .reconnecting = false ;
497504 if (this .readyState != ReadyState .OPEN ) {
505+ // `onclose` will not fire because
506+ // an open event never happened
498507 this .cleanup ();
499508 }
500- this .skipReconnect = true ;
501- this .reconnecting = false ;
502509 this .backoff .reset ();
503510 this .readyState = ReadyState .CLOSED ;
504511 if (this .engine != null ) {
@@ -507,7 +514,7 @@ private void cleanup() {
507514 }
508515
509516 private void onclose (String reason ) {
510- logger .fine ("close " );
517+ logger .fine ("onclose " );
511518 this .cleanup ();
512519 this .backoff .reset ();
513520 this .readyState = ReadyState .CLOSED ;
You can’t perform that action at this time.
0 commit comments