| Index: runtime/bin/socket_patch.dart
|
| diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
|
| index 23edced3827c28622e041684692ae690b0d9473e..3b502a2f32aee80a8670f375b6dd0c956a0d909c 100644
|
| --- a/runtime/bin/socket_patch.dart
|
| +++ b/runtime/bin/socket_patch.dart
|
| @@ -66,8 +66,10 @@ class _SocketBase extends NativeFieldWrapperClass1 {
|
|
|
| var eventHandler = _handlerMap[i];
|
| if (eventHandler != null || i == _ERROR_EVENT) {
|
| - // Unregister the out handler before executing it.
|
| - if (i == _OUT_EVENT) _setHandler(i, null);
|
| + // Unregister the out handler before executing it. There is
|
| + // no need to notify the eventhandler as handlers are
|
| + // disabled while the event is handled.
|
| + if (i == _OUT_EVENT) _setHandler(i, null, notifyEventhandler: false);
|
|
|
| // Don't call the in handler if there is no data available
|
| // after all.
|
| @@ -87,7 +89,9 @@ class _SocketBase extends NativeFieldWrapperClass1 {
|
| _activateHandlers();
|
| }
|
|
|
| - void _setHandler(int event, Function callback) {
|
| + void _setHandler(int event,
|
| + Function callback,
|
| + {bool notifyEventhandler: true}) {
|
| if (callback == null) {
|
| _handlerMask &= ~(1 << event);
|
| } else {
|
| @@ -103,7 +107,7 @@ class _SocketBase extends NativeFieldWrapperClass1 {
|
| _handler.close();
|
| _handler = null;
|
| } else {
|
| - _activateHandlers();
|
| + if (notifyEventhandler) _activateHandlers();
|
| }
|
| }
|
|
|
|
|