Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify end() and end event usage #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ is important to know that an active adversary did not truncate the stream.
Call `setTimeout` on the underlying `rawStream` if supported. This function will
be undefined if not supported

### `secureStream.on('end')`

When one side calls `secureStream.end()`, the other side must also call `secureStream.end()` from its `end` event. When using a library like [pump](https://github.com/mafintosh/pump), this will happen automatically. Otherwise you will likely need to handle this event and call `secureStream.end()` from both ends to handle either side ending the secure stream.

### `secureStream.on('timeout')`

Bubble `timeout` event from the underlying `rawStream` if supported. You should
Expand Down