[whatwg/streams] Update WebSocket examples (#713)

I recently learned that WebSockets will tell you if they closed cleanly. This allows us to illustrate returning a potentially-rejected promise from the underlying sink's close() and abort() methods.

This also makes the writable streams error themselves if the WebSockets are closed by the server (as opposed to closed by the client), as this represents an unexpected cessation of the ability to write data.

Finally this synchronizes the examples so that they both send a status code of 1000 for closing successfully.

---

Please carefully check my semantics here as I have not used the web socket API in anger recently. I may not be holding it right.
You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/streams/pull/713

-- Commit Summary --

  * Update WebSocket examples

-- File Changes --

    M index.bs (46)

-- Patch Links --

https://github.com/whatwg/streams/pull/713.patch
https://github.com/whatwg/streams/pull/713.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/713

Received on Tuesday, 28 March 2017 11:26:01 UTC