File tree 1 file changed +4
-10
lines changed
1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -836,26 +836,20 @@ function internalConnect(
836
836
var err ;
837
837
838
838
if ( localAddress || localPort ) {
839
- var bind ;
839
+ debug ( 'binding to localAddress: %s and localPort: %d (addressType: %d)' ,
840
+ localAddress , localPort , addressType ) ;
840
841
841
842
if ( addressType === 4 ) {
842
843
localAddress = localAddress || '0.0.0.0' ;
843
- bind = self . _handle . bind ;
844
+ err = self . _handle . bind ( localAddress , localPort ) ;
844
845
} else if ( addressType === 6 ) {
845
846
localAddress = localAddress || '::' ;
846
- bind = self . _handle . bind6 ;
847
+ err = self . _handle . bind6 ( localAddress , localPort ) ;
847
848
} else {
848
849
self . _destroy ( new TypeError ( 'Invalid addressType: ' + addressType ) ) ;
849
850
return ;
850
851
}
851
852
852
- debug ( 'binding to localAddress: %s and localPort: %d' ,
853
- localAddress ,
854
- localPort ) ;
855
-
856
- bind = bind . bind ( self . _handle ) ;
857
- err = bind ( localAddress , localPort ) ;
858
-
859
853
if ( err ) {
860
854
const ex = exceptionWithHostPort ( err , 'bind' , localAddress , localPort ) ;
861
855
self . _destroy ( ex ) ;
You can’t perform that action at this time.
0 commit comments