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 = "127.0.0.1", | 6 /* patch */ static Future<RawServerSocket> bind(address, |
7 int port = 0, | 7 int port, |
8 int backlog = 0]) { | 8 {int backlog: 0}) { |
9 if (address == null) address = InternetAddress.LOOPBACK_IP_V4; | |
Anders Johnsen
2013/05/01 07:50:19
No 'null' check - should not be null.
Søren Gjesse
2013/05/01 07:55:20
Done.
| |
9 return _RawServerSocket.bind(address, port, backlog); | 10 return _RawServerSocket.bind(address, port, backlog); |
10 } | 11 } |
11 } | 12 } |
12 | 13 |
13 | 14 |
14 patch class RawSocket { | 15 patch class RawSocket { |
15 /* patch */ static Future<RawSocket> connect(host, int port) { | 16 /* patch */ static Future<RawSocket> connect(host, int port) { |
16 return _RawSocket.connect(host, port); | 17 return _RawSocket.connect(host, port); |
17 } | 18 } |
18 } | 19 } |
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
730 if (_controller.hasListener) { | 731 if (_controller.hasListener) { |
731 _resume(); | 732 _resume(); |
732 } else { | 733 } else { |
733 close(); | 734 close(); |
734 } | 735 } |
735 } | 736 } |
736 } | 737 } |
737 | 738 |
738 | 739 |
739 patch class ServerSocket { | 740 patch class ServerSocket { |
740 /* patch */ static Future<ServerSocket> bind([address = "127.0.0.1", | 741 /* patch */ static Future<ServerSocket> bind(address, |
741 int port = 0, | 742 int port, |
742 int backlog = 0]) { | 743 {int backlog: 0}) { |
743 return _ServerSocket.bind(address, port, backlog); | 744 return _ServerSocket.bind(address, port, backlog); |
744 } | 745 } |
745 } | 746 } |
746 | 747 |
747 class _ServerSocket extends Stream<Socket> | 748 class _ServerSocket extends Stream<Socket> |
748 implements ServerSocket { | 749 implements ServerSocket { |
749 final _socket; | 750 final _socket; |
750 | 751 |
751 static Future<_ServerSocket> bind(address, | 752 static Future<_ServerSocket> bind(address, |
752 int port, | 753 int port, |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1088 _raw.onBadCertificate = callback; | 1089 _raw.onBadCertificate = callback; |
1089 } | 1090 } |
1090 | 1091 |
1091 X509Certificate get peerCertificate { | 1092 X509Certificate get peerCertificate { |
1092 if (_raw == null) { | 1093 if (_raw == null) { |
1093 throw new StateError("peerCertificate called on destroyed SecureSocket"); | 1094 throw new StateError("peerCertificate called on destroyed SecureSocket"); |
1094 } | 1095 } |
1095 return _raw.peerCertificate; | 1096 return _raw.peerCertificate; |
1096 } | 1097 } |
1097 } | 1098 } |
OLD | NEW |