File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -708,8 +708,16 @@ class Connection extends EventEmitter {
708708 const quitCmd = new Quit ( cmdParam , ended , ended ) ;
709709 this . sendQueue . push ( quitCmd ) ;
710710 this . receiveQueue . push ( quitCmd ) ;
711+
712+ // Deno compatibility: send QUIT immediately to avoid socket resource cleanup issues
713+ const isDeno = typeof Deno !== 'undefined' ;
711714 if ( this . sendQueue . length === 1 ) {
712- process . nextTick ( this . nextSendCmd . bind ( this ) ) ;
715+ if ( isDeno ) {
716+ // Send synchronously in Deno to ensure COM_QUIT is sent before socket cleanup
717+ this . nextSendCmd ( ) ;
718+ } else {
719+ process . nextTick ( this . nextSendCmd . bind ( this ) ) ;
720+ }
713721 }
714722 } else resolve ( ) ;
715723 }
@@ -774,7 +782,12 @@ class Connection extends EventEmitter {
774782 self . sendQueue . push ( quitCmd ) ;
775783 self . receiveQueue . push ( quitCmd ) ;
776784 if ( self . sendQueue . length === 1 ) {
777- process . nextTick ( self . nextSendCmd . bind ( self ) ) ;
785+ const isDeno = typeof Deno !== 'undefined' ;
786+ if ( isDeno ) {
787+ self . nextSendCmd ( ) ;
788+ } else {
789+ process . nextTick ( self . nextSendCmd . bind ( self ) ) ;
790+ }
778791 }
779792 } ) ;
780793 } else {
You can’t perform that action at this time.
0 commit comments