Keep track of when a socket has been destroyed

This adds the event CLOSED to RawSocket and RawServerSocket. This
event indicate that the underlying socket is now destroyed.

This is used to make Socket.close and ServerSocket.close return a
future which is completed when the unserlying socket is
destroyed. This can be used to start listening on the same port after
closing a server socket.

R=ajohnsen@google.com, kustermann@google.com

BUG=https://code.google.com/p/dart/issues/detail?id=4155

Review URL: https://codereview.chromium.org//14864009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart/pkg/http@25213 260f80e4-7a28-3924-810f-c04153c831b5
1 file changed
tree: a6f5099fc79f33b46cbcc2bc388808d61b8170ac
  1. lib/
  2. test/
  3. pubspec.yaml