| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 patch class RawServerSocket { | 5 patch class RawServerSocket { |
| 6 /* patch */ static Future<RawServerSocket> bind(address, | 6 /* patch */ static Future<RawServerSocket> bind(address, |
| 7 int port, | 7 int port, |
| 8 {int backlog: 0, | 8 {int backlog: 0, |
| 9 bool v6Only: false}) { | 9 bool v6Only: false}) { |
| 10 return _RawServerSocket.bind(address, port, backlog, v6Only); | 10 return _RawServerSocket.bind(address, port, backlog, v6Only); |
| (...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 if (i == WRITE_EVENT) { | 737 if (i == WRITE_EVENT) { |
| 738 writeAvailable = true; | 738 writeAvailable = true; |
| 739 issueWriteEvent(delayed: false); | 739 issueWriteEvent(delayed: false); |
| 740 continue; | 740 continue; |
| 741 } | 741 } |
| 742 | 742 |
| 743 if (i == READ_EVENT) { | 743 if (i == READ_EVENT) { |
| 744 if (isListening) { | 744 if (isListening) { |
| 745 available++; | 745 available++; |
| 746 } else { | 746 } else { |
| 747 var avail = nativeAvailable(); | 747 available = nativeAvailable(); |
| 748 if (avail is int) { | |
| 749 available = avail; | |
| 750 } else { | |
| 751 // Available failed. Mark socket as having data, to ensure read | |
| 752 // events, and thus reporting of this error. | |
| 753 available = 1; | |
| 754 } | |
| 755 issueReadEvent(); | 748 issueReadEvent(); |
| 756 continue; | 749 continue; |
| 757 } | 750 } |
| 758 } | 751 } |
| 759 | 752 |
| 760 var handler = eventHandlers[i]; | 753 var handler = eventHandlers[i]; |
| 761 if (i == DESTROYED_EVENT) { | 754 if (i == DESTROYED_EVENT) { |
| 762 assert(isClosing); | 755 assert(isClosing); |
| 763 assert(!isClosed); | 756 assert(!isClosed); |
| 764 isClosed = true; | 757 isClosed = true; |
| (...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1927 String address, | 1920 String address, |
| 1928 List<int> in_addr, | 1921 List<int> in_addr, |
| 1929 int port) { | 1922 int port) { |
| 1930 return new Datagram( | 1923 return new Datagram( |
| 1931 data, | 1924 data, |
| 1932 new _InternetAddress(address, null, in_addr), | 1925 new _InternetAddress(address, null, in_addr), |
| 1933 port); | 1926 port); |
| 1934 } | 1927 } |
| 1935 | 1928 |
| 1936 String _socketsStats() => _SocketsObservatory.toJSON(); | 1929 String _socketsStats() => _SocketsObservatory.toJSON(); |
| OLD | NEW |