Index: sdk/lib/io/websocket_impl.dart |
diff --git a/sdk/lib/io/websocket_impl.dart b/sdk/lib/io/websocket_impl.dart |
index d7408b9ff544396b64432f636d6bf09904f6949d..673fe23331706c318e3cb655e1b863a17e9cd2ad 100644 |
--- a/sdk/lib/io/websocket_impl.dart |
+++ b/sdk/lib/io/websocket_impl.dart |
@@ -453,17 +453,13 @@ class _WebSocketConnectionBase { |
if (_closeTimer != null) _closeTimer.cancel(); |
_socket.close(); |
}; |
- _closeTimer = new Timer(5000, (t) { |
- _socket.close(); |
- }); |
+ _closeTimer = new Timer(const Duration(seconds: 5), _socket.close); |
} else { |
// Half close the socket and expect a close frame in response |
// before closing the socket. If a close frame does not arrive |
// within a reasonable amount of time just close the socket. |
_socket.outputStream.close(); |
- _closeTimer = new Timer(5000, (t) { |
- _socket.close(); |
- }); |
+ _closeTimer = new Timer(const Duration(seconds: 5), _socket.close); |
} |
_closeSent = true; |
} |