dart-lang/spark — pull request #1135 by devoncarew (2014-02-24 16:52:37+00:00)
Title: Devoncarew networking

Switch the tcp.dart library over to using the new `chrome.sockets` API. The API is similar, except that:

- the data comes in as events instead of polling for new data
- client sockets have to be unpaused when received from server sockets
- you need to map the incoming data using the socketId to associated StreamController

Note that this does solve the issue of our background page hanging around indefinitely. We don't have to do any additional work to try closing the server socket in the background page. It closes automatically a few seconds after the main window closes.

Fixes #1120.

@dinhviethoa, ussuri