| Index: runtime/bin/socket_stream_impl.dart
|
| diff --git a/runtime/bin/socket_stream_impl.dart b/runtime/bin/socket_stream_impl.dart
|
| index cf9f59092b1d4b7a5192086bec9eeda485aee8a3..ac750b9c091bf8be33c60f7458d78103de011f97 100644
|
| --- a/runtime/bin/socket_stream_impl.dart
|
| +++ b/runtime/bin/socket_stream_impl.dart
|
| @@ -112,7 +112,7 @@ class _SocketOutputStream
|
| if (!_pendingWrites.isEmpty()) {
|
| // Mark the socket for close when all data is written.
|
| _closing = true;
|
| - _setupWriteHander();
|
| + _socket._onWrite = _onWrite;
|
| } else {
|
| // Close the socket for writing.
|
| _socket._closeWrite();
|
| @@ -128,19 +128,9 @@ class _SocketOutputStream
|
| }
|
|
|
| void set onNoPendingWrites(void callback()) {
|
| - if (_noPendingWritesTimer != null) {
|
| - _noPendingWritesTimer.cancel();
|
| - _noPendingWritesTimer = null;
|
| - }
|
| _onNoPendingWrites = callback;
|
| if (_onNoPendingWrites != null) {
|
| - if (_pendingWrites.isEmpty()) {
|
| - _noPendingWritesTimer = new Timer(0, (t) {
|
| - if (_onNoPendingWrites != null) _onNoPendingWrites();
|
| - });
|
| - } else {
|
| - _setupWriteHander();
|
| - }
|
| + _socket._onWrite = _onWrite;
|
| }
|
| }
|
|
|
| @@ -164,7 +154,7 @@ class _SocketOutputStream
|
| assert(offset + len == buffer.length);
|
| _pendingWrites.add(buffer, notWrittenOffset);
|
| }
|
| - _setupWriteHander();
|
| + _socket._onWrite = _onWrite;
|
| return false;
|
| }
|
|
|
| @@ -196,16 +186,6 @@ class _SocketOutputStream
|
| }
|
| }
|
|
|
| - void _setupWriteHander() {
|
| - // Set up the callback for writing the pending data as the
|
| - // underlying socket becomes ready for writing.
|
| - if (_noPendingWritesTimer != null) {
|
| - _noPendingWritesTimer.cancel();
|
| - _noPendingWritesTimer = null;
|
| - }
|
| - _socket._onWrite = _onWrite;
|
| - }
|
| -
|
| bool _onSocketError(e) {
|
| close();
|
| if (_onError != null) {
|
| @@ -219,7 +199,6 @@ class _SocketOutputStream
|
| Socket _socket;
|
| _BufferList _pendingWrites;
|
| Function _onNoPendingWrites;
|
| - Timer _noPendingWritesTimer;
|
| bool _closing = false;
|
| bool _closed = false;
|
| }
|
|
|