| `onSuccess` | `() => void` | Success callback, called after data are successfully written to the output stream. (optional)|
| `onError` | `(message: string) => void` | Error callback, called when some error occurs during writing of data to the output stream. (optional)|
#### `shutdownWrite(onSuccess?, onError?): void`
Finishes sending of data by sending `FIN` to remote host. If you call `write` after invoking `shutdownWrite`, callback `onError` (of `write` method) will be called.
| `onSuccess` | `() => void` | Success callback, called after connection was successfully closed. `onClose` event handler is called after that callback. (optional)|
| `onError` | `(message: string) => void` | Error callback, called when some error occurs during this procedure. (optional)|