sysapps / tcp-udp-sockets

Raw sockets API
85 stars 25 forks source link

Define the behavior of closing a socket before openedPromise is resolved #72

Closed schien closed 10 years ago

schien commented 10 years ago

The socket open is now asynchronous so it is possible to close a socket before it is opened. For example:

var socket = new UDPSocket();
socket.close();

In current draft this scenario seems not be clearly defined. We have two choices here:

  1. reject openedPromise with a DOMException (error cause TBD)
  2. not resolve or reject openedPromise
schien commented 10 years ago

Sorry, I found the behavior is included in output.cancel() and should throw AbortError in this case.