Skip to content

Commit

Permalink
dgram: remove unnecessary fd property from Socket
Browse files Browse the repository at this point in the history
It seems the property socket.fd is used long before for the
compatibility reason but it's not used anymore. It's also
not documented in docs so that it's not a public api/property.
Keep the property also make the code a bit confusing as
socket._handle.fd is the actual property representing fd.
  • Loading branch information
oyyd committed Aug 10, 2018
1 parent c7962dc commit 4fa3fbd
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions lib/dgram.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ function Socket(type, listener) {

this[async_id_symbol] = handle.getAsyncId();
this.type = type;
this.fd = null; // compatibility hack

if (typeof listener === 'function')
this.on('message', listener);
Expand Down Expand Up @@ -116,7 +115,6 @@ function startListening(socket) {
state.handle.recvStart();
state.receiving = true;
state.bindState = BIND_STATE_BOUND;
socket.fd = -42; // compatibility hack

if (state.recvBufferSize)
bufferSize(socket, state.recvBufferSize, RECV_BUFFER);
Expand Down Expand Up @@ -677,7 +675,6 @@ function stopReceiving(socket) {

state.handle.recvStop();
state.receiving = false;
socket.fd = null; // compatibility hack
}


Expand Down

0 comments on commit 4fa3fbd

Please sign in to comment.