Skip to content

Commit

Permalink
Minor changes to the connection errors section of Mojo bindings docs.
Browse files Browse the repository at this point in the history
BUG=None

Change-Id: I4f0c8fd5a24a5bfc1f3a81c96026a33c7700639e
Reviewed-on: https://chromium-review.googlesource.com/538980
Commit-Queue: Yuzhu Shen <yzshen@chromium.org>
Reviewed-by: Randy Smith <rdsmith@chromium.org>
Cr-Commit-Position: refs/heads/master@{#481024}
  • Loading branch information
yzshen authored and Commit Bot committed Jun 20, 2017
1 parent 9b8f6e4 commit 92e791a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
16 changes: 12 additions & 4 deletions mojo/public/cpp/bindings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,18 @@ parameters.
### Connection Errors
If there are no remaining messages available on a pipe and the remote end has
been closed, a connection error will be triggered on the local end. Connection
errors may also be triggered by automatic forced local pipe closure due to
*e.g.* a validation error when processing a received message.
If a pipe is disconnected, both endpoints will be able to observe the connection
error (unless the disconnection is caused by closing/destroying an endpoint, in
which case that endpoint won't get such a notification). If there are remaining
incoming messages for an endpoint on disconnection, the connection error won't
be triggered until the messages are drained.
Pipe disconnecition may be caused by:
* Mojo system-level causes: process terminated, resource exhausted, etc.
* The bindings close the pipe due to a validation error when processing a
received message.
* The peer endpoint is closed. For example, the remote side is a bound
`mojo::InterfacePtr<T>` and it is destroyed.
Regardless of the underlying cause, when a connection error is encountered on
a binding endpoint, that endpoint's **connection error handler** (if set) is
Expand Down
16 changes: 12 additions & 4 deletions mojo/public/js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,18 @@ the service side sends back a response. It is rejected if the interface is
disconnected.

### Connection Errors
If there are no remaining messages available on a pipe and the remote end has
been closed, a connection error will be triggered on the local end. Connection
errors may also be triggered by automatic forced local pipe closure due to
*e.g.* a validation error when processing a received message.
If a pipe is disconnected, both endpoints will be able to observe the connection
error (unless the disconnection is caused by closing/destroying an endpoint, in
which case that endpoint won't get such a notification). If there are remaining
incoming messages for an endpoint on disconnection, the connection error won't
be triggered until the messages are drained.

Pipe disconnecition may be caused by:
* Mojo system-level causes: process terminated, resource exhausted, etc.
* The bindings close the pipe due to a validation error when processing a
received message.
* The peer endpoint is closed. For example, the remote side is a bound interface
pointer and it is destroyed.

Regardless of the underlying cause, when a connection error is encountered on
a binding endpoint, that endpoint's **connection error handler** (if set) is
Expand Down

0 comments on commit 92e791a

Please sign in to comment.