diff --git a/doc/api/net.md b/doc/api/net.md index a9d84e0b174882..aa2b918ecdac12 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -722,25 +722,26 @@ that the [`socket.connect(options[, connectListener])`][`socket.connect(options)`] callback is a listener for the `'connect'` event. -### `socket.destroy([exception])` +### `socket.destroy([error])` -* `exception` {Object} +* `error` {Object} * Returns: {net.Socket} -Ensures that no more I/O activity happens on this socket. Only necessary in -case of errors (parse error or so). +Ensures that no more I/O activity happens on this socket. +Destroys the stream and closes the connection. -If `exception` is specified, an [`'error'`][] event will be emitted and any -listeners for that event will receive `exception` as an argument. +See [`writable.destroy()`][] for further details. ### `socket.destroyed` * {boolean} Indicates if the connection is destroyed or not. Once a connection is destroyed no further data can be transferred using it. +See [`writable.destroyed`][] for further details. + ### `socket.end([data[, encoding]][, callback])`