dglazkov / tubes

Web Platform Plumbing
Apache License 2.0
11 stars 0 forks source link

Need a way to close the connection. #9

Open omo opened 10 years ago

omo commented 10 years ago

To keep opening the connection prevent the destination service from reclaimed. We need something like port.close()/disconnect()/abort().

rginda commented 10 years ago

MessagePort objects have a close() already. That close isn't communicated to the other end though, which is trouble. Without a MessagePort.prototype.onclose event, both sides will have to resort to regular ping/pong messages to know if the connection is still valid.

Similarly, MessagePort.prototype.start() starts up the event delivery, but isn't communicated to the other end. Without an onstart event, the destination side will have to send predetermined message to signal that they've accepted the connection.

omo commented 10 years ago

Thanks for the explanation. Apparently we need more detail on other side of the port in general, like, how service worker knows about the connection being established.