Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(349)

Unified Diff: sdk/lib/io/websocket_impl.dart

Issue 12393005: When the socket is closed, we can end up trying to send a close packet, before we get the async 'so… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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]) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698