joyent/node — pull request #3456 by reid (2012-06-16 06:09:54+00:00)
Title: net: Prevent property access throws during close

Fix #3455.

The remoteAddress and remotePort properties are dynamically retrieved from _getpeername().

While _getpeername() checks if the _handle is null, it is also possible for the tcp_wrapped _handle.getpeername() to return null on error.

Such a condition happens when the remote closes and one of these properties is accessed before _handle is set to null.