sysapps / tcp-udp-sockets

Raw sockets API
86 stars 25 forks source link

Streams integration: change from .wait() to .ready #83

Closed domenic closed 9 years ago

domenic commented 9 years ago

I did a scan and .wait() is only used in notes and in examples so this is pretty minor. But in https://github.com/whatwg/streams/issues/243 we changed from a side-effecting .wait() to a passive .ready in the public API.

ClaesNilsson commented 9 years ago

Ok, thanks for spotting this Domenic. I'll replace .wait() with .ready in the examples and comments. Furthermore I see in https://github.com/whatwg/streams/issues/245 that .ready is fulfill-only. So in the examples in the TCP and UDP Socket API specification errors must be handled in another way than with a promise reject function for .ready. I guess that I just can remove the promise reject handling and rely on mySocket.closed... handling to detect for example situations like loss of network contact.

domenic commented 9 years ago

Oh yeah, sorry for not noticing that too.

I guess that I just can remove the promise reject handling and rely on mySocket.closed... handling to detect for example situations like loss of network contact.

That was exactly the reasoning :)

ClaesNilsson commented 9 years ago

I fill that and make a PR.

ClaesNilsson commented 9 years ago

Looks ok? https://github.com/sysapps/tcp-udp-sockets/pull/84

ClaesNilsson commented 9 years ago

Closed with https://github.com/sysapps/tcp-udp-sockets/pull/84