| Index: runtime/bin/socket_patch.dart
|
| diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
|
| index 23e3f9e200269a9b5423cf64a983c5330fc1af31..d598e273825b799e08ea8fed332508482b1d43c3 100644
|
| --- a/runtime/bin/socket_patch.dart
|
| +++ b/runtime/bin/socket_patch.dart
|
| @@ -568,13 +568,11 @@ class _NativeSocket extends _NativeSocketNativeWrapper with _ServiceObject {
|
| return null;
|
| }
|
| if (result != null) {
|
| - if (Platform.isMacOS) {
|
| - // Mac includes the header size, so we need to query the actual
|
| - // available.
|
| - available = nativeAvailable();
|
| - } else {
|
| - available -= result.data.length;
|
| - }
|
| + // Read the next available. Available is only for the next datagram, not
|
| + // the sum of all datagrams pending, so we need to call after each
|
| + // receive. If available becomes > 0, the _NativeSocket will continue to
|
| + // emit read events.
|
| + available = nativeAvailable();
|
| totalRead += result.data.length;
|
| }
|
| readCount++;
|
|
|