diff --git a/lib/dgram.js b/lib/dgram.js index a8de95111f8412..292f7daf876c43 100644 --- a/lib/dgram.js +++ b/lib/dgram.js @@ -684,7 +684,69 @@ Socket.prototype.getSendBufferSize = function() { }; +// Legacy private APIs to be deprecated in the future. +Object.defineProperty(Socket.prototype, '_handle', { + get() { + return this[kStateSymbol].handle; + }, + set(val) { + this[kStateSymbol].handle = val; + } +}); + + +Object.defineProperty(Socket.prototype, '_receiving', { + get() { + return this[kStateSymbol].receiving; + }, + set(val) { + this[kStateSymbol].receiving = val; + } +}); + + +Object.defineProperty(Socket.prototype, '_bindState', { + get() { + return this[kStateSymbol].bindState; + }, + set(val) { + this[kStateSymbol].bindState = val; + } +}); + + +Object.defineProperty(Socket.prototype, '_queue', { + get() { + return this[kStateSymbol].queue; + }, + set(val) { + this[kStateSymbol].queue = val; + } +}); + + +Object.defineProperty(Socket.prototype, '_reuseAddr', { + get() { + return this[kStateSymbol].reuseAddr; + }, + set(val) { + this[kStateSymbol].reuseAddr = val; + } +}); + + +Socket.prototype._healthCheck = function() { + healthCheck(this); +}; + + +Socket.prototype._stopReceiving = function() { + stopReceiving(this); +}; + + module.exports = { + _createSocketHandle, createSocket, Socket };