@@ -436,7 +436,7 @@ function doConnect(ex, self, ip, address, port, callback) {
436436
437437 if ( ex ) {
438438 state . connectState = CONNECT_STATE_DISCONNECTED ;
439- return process . nextTick ( ( ) => {
439+ return process . _deferTick ( ( ) => {
440440 if ( callback ) {
441441 self . removeListener ( 'connect' , callback ) ;
442442 callback ( ex ) ;
@@ -447,7 +447,7 @@ function doConnect(ex, self, ip, address, port, callback) {
447447 }
448448
449449 state . connectState = CONNECT_STATE_CONNECTED ;
450- process . nextTick ( ( ) => self . emit ( 'connect' ) ) ;
450+ process . _deferTick ( ( ) => self . emit ( 'connect' ) ) ;
451451}
452452
453453
@@ -680,11 +680,11 @@ function doSend(ex, self, ip, list, address, port, callback) {
680680
681681 if ( ex ) {
682682 if ( typeof callback === 'function' ) {
683- process . nextTick ( callback , ex ) ;
683+ process . _deferTick ( callback , ex ) ;
684684 return ;
685685 }
686686
687- process . nextTick ( ( ) => self . emit ( 'error' , ex ) ) ;
687+ process . _deferTick ( ( ) => self . emit ( 'error' , ex ) ) ;
688688 return ;
689689 } else if ( ! state . handle ) {
690690 return ;
@@ -709,14 +709,14 @@ function doSend(ex, self, ip, list, address, port, callback) {
709709 // Synchronous finish. The return code is msg_length + 1 so that we can
710710 // distinguish between synchronous success and asynchronous success.
711711 if ( callback )
712- process . nextTick ( callback , null , err - 1 ) ;
712+ process . _deferTick ( callback , null , err - 1 ) ;
713713 return ;
714714 }
715715
716716 if ( err && callback ) {
717717 // Don't emit as error, dgram_legacy.js compatibility
718718 const ex = new ExceptionWithHostPort ( err , 'send' , address , port ) ;
719- process . nextTick ( callback , ex ) ;
719+ process . _deferTick ( callback , ex ) ;
720720 }
721721}
722722
@@ -747,7 +747,7 @@ Socket.prototype.close = function(callback) {
747747 state . handle . close ( ) ;
748748 state . handle = null ;
749749 defaultTriggerAsyncIdScope ( this [ async_id_symbol ] ,
750- process . nextTick ,
750+ process . _deferTick ,
751751 socketCloseNT ,
752752 this ) ;
753753
0 commit comments