Index: sdk/lib/io/websocket_impl.dart |
diff --git a/sdk/lib/io/websocket_impl.dart b/sdk/lib/io/websocket_impl.dart |
index d7debece5fbc71636aed893b4b72dfe91d2af28a..12539d67af22e4a883efa90484782eda991beb99 100644 |
--- a/sdk/lib/io/websocket_impl.dart |
+++ b/sdk/lib/io/websocket_impl.dart |
@@ -641,7 +641,12 @@ class _WebSocketImpl extends Stream<Event> implements WebSocket { |
} else { |
opcode = _WebSocketOpcode.TEXT; |
} |
- _sendFrame(opcode, data); |
+ try { |
+ _sendFrame(opcode, data); |
+ } catch (_) { |
+ // The socket can be closed before _socket.done have a chance |
+ // to complete. |
+ } |
} |
void _sendFrame(int opcode, [List<int> data]) { |