| Index: runtime/bin/socket_patch.dart
|
| diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
|
| index c866977f29ad60b7ac3b771a39e57f68add1782f..dfbd46589e564f18d875c00975941125320c3c9d 100644
|
| --- a/runtime/bin/socket_patch.dart
|
| +++ b/runtime/bin/socket_patch.dart
|
| @@ -287,6 +287,7 @@ class _NativeSocket extends _NativeSocketNativeWrapper with _ServiceObject {
|
| bool isClosed = false;
|
| bool isClosing = false;
|
| bool isClosedRead = false;
|
| + bool closedReadEventSent = false;
|
| bool isClosedWrite = false;
|
| Completer closeCompleter = new Completer.sync();
|
|
|
| @@ -694,6 +695,7 @@ class _NativeSocket extends _NativeSocketNativeWrapper with _ServiceObject {
|
| }
|
|
|
| void issueReadEvent() {
|
| + if (closedReadEventSent) return;
|
| if (readEventIssued) return;
|
| readEventIssued = true;
|
| void issue() {
|
| @@ -701,10 +703,11 @@ class _NativeSocket extends _NativeSocketNativeWrapper with _ServiceObject {
|
| if (isClosing) return;
|
| if (!sendReadEvents) return;
|
| if (available == 0) {
|
| - if (isClosedRead) {
|
| + if (isClosedRead && !closedReadEventSent) {
|
| if (isClosedWrite) close();
|
| var handler = eventHandlers[CLOSED_EVENT];
|
| if (handler == null) return;
|
| + closedReadEventSent = true;
|
| handler();
|
| }
|
| return;
|
| @@ -860,7 +863,7 @@ class _NativeSocket extends _NativeSocketNativeWrapper with _ServiceObject {
|
|
|
| void shutdownWrite() {
|
| if (!isClosing && !isClosed) {
|
| - if (isClosedRead) {
|
| + if (closedReadEventSent) {
|
| close();
|
| } else {
|
| sendToEventHandler(1 << SHUTDOWN_WRITE_COMMAND);
|
|
|