This repository was archived by the owner on Apr 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,17 @@ function Socket(options) {
84
84
85
85
stream . Stream . call ( this ) ;
86
86
87
+ if ( typeof options == 'number' ) {
88
+ // Legacy interface. Uncomment the following lines after
89
+ // libuv backend is stable and API compatibile with legaacy.
90
+ // console.error('Deprecated interface net.Socket(fd).');
91
+ // console.trace();
92
+ // Must support legacy interface. NPM depends on it.
93
+ // https://github.com/isaacs/npm/blob/c7824f412f0cb59d6f55cf0bc220253c39e6029f/lib/utils/output.js#L110
94
+ // TODO Before we can do this we need a way to open a uv_stream_t by fd.
95
+ throw new Error ( "Not yet implemented" )
96
+ }
97
+
87
98
// private
88
99
this . _handle = options && options . handle ;
89
100
initSocketHandle ( this ) ;
@@ -245,7 +256,7 @@ Socket.prototype.destroy = function(exception) {
245
256
246
257
self . _connectQueueCleanUp ( ) ;
247
258
248
- debug ( 'destroy ' + this . fd ) ;
259
+ debug ( 'destroy' ) ;
249
260
250
261
this . readable = this . writable = false ;
251
262
@@ -256,7 +267,7 @@ Socket.prototype.destroy = function(exception) {
256
267
this . server . _emitCloseIfDrained ( ) ;
257
268
}
258
269
259
- debug ( 'close ' + this . fd ) ;
270
+ debug ( 'close' ) ;
260
271
if ( this . _handle ) {
261
272
this . _handle . close ( ) ;
262
273
this . _handle = null ;
You can’t perform that action at this time.
0 commit comments