From 92e791aa362b772defadc15d9f0b01f846172a36 Mon Sep 17 00:00:00 2001 From: Yuzhu Shen Date: Tue, 20 Jun 2017 13:39:31 -0700 Subject: [PATCH] Minor changes to the connection errors section of Mojo bindings docs. BUG=None Change-Id: I4f0c8fd5a24a5bfc1f3a81c96026a33c7700639e Reviewed-on: https://chromium-review.googlesource.com/538980 Commit-Queue: Yuzhu Shen Reviewed-by: Randy Smith Cr-Commit-Position: refs/heads/master@{#481024} --- mojo/public/cpp/bindings/README.md | 16 ++++++++++++---- mojo/public/js/README.md | 16 ++++++++++++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/mojo/public/cpp/bindings/README.md b/mojo/public/cpp/bindings/README.md index c43a132e84a690..a98708ef448fb8 100644 --- a/mojo/public/cpp/bindings/README.md +++ b/mojo/public/cpp/bindings/README.md @@ -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` 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 diff --git a/mojo/public/js/README.md b/mojo/public/js/README.md index 862be292453567..b978c2eebabe09 100644 --- a/mojo/public/js/README.md +++ b/mojo/public/js/README.md @@ -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