| Index: runtime/bin/socket_impl.dart
|
| diff --git a/runtime/bin/socket_impl.dart b/runtime/bin/socket_impl.dart
|
| index b797d7de82464dbc7991557145aea80fe5dcde2e..9d70302eeb45f19d1a91c60788e26cc8e9d5f73d 100644
|
| --- a/runtime/bin/socket_impl.dart
|
| +++ b/runtime/bin/socket_impl.dart
|
| @@ -240,12 +240,23 @@ class _ServerSocket extends _SocketBase implements ServerSocket {
|
| bool _createBindListen(String bindAddress, int port, int backlog)
|
| native "ServerSocket_CreateBindListen";
|
|
|
| - void set connectionHandler(void callback()) {
|
| - _setHandler(_IN_EVENT, callback);
|
| + void set connectionHandler(void callback(Socket connection)) {
|
| + _clientConnectionHandler = callback;
|
| + _setHandler(_IN_EVENT,
|
| + _clientConnectionHandler != null ? _connectionHandler : null);
|
| + }
|
| +
|
| + void _connectionHandler() {
|
| + if (_id >= 0) {
|
| + _Socket socket = new _Socket._internal();
|
| + if (_accept(socket)) _clientConnectionHandler(socket);
|
| + }
|
| }
|
|
|
| bool _isListenSocket() => true;
|
| bool _isPipe() => false;
|
| +
|
| + var _clientConnectionHandler;
|
| }
|
|
|
|
|
|
|