| 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 | 5 @patch |
| 6 class RawServerSocket { | 6 class RawServerSocket { |
| 7 @patch | 7 @patch |
| 8 static Future<RawServerSocket> bind(address, int port, | 8 static Future<RawServerSocket> bind(address, int port, |
| 9 {int backlog: 0, bool v6Only: false, bool shared: false}) { | 9 {int backlog: 0, bool v6Only: false, bool shared: false}) { |
| 10 return _RawServerSocket.bind(address, port, backlog, v6Only, shared); | 10 return _RawServerSocket.bind(address, port, backlog, v6Only, shared); |
| (...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1046 for (int i = 0; i < interface.addresses.length; i++) { | 1046 for (int i = 0; i < interface.addresses.length; i++) { |
| 1047 if (interface.addresses[i].type == InternetAddressType.IP_V4) { | 1047 if (interface.addresses[i].type == InternetAddressType.IP_V4) { |
| 1048 return interface.addresses[i]; | 1048 return interface.addresses[i]; |
| 1049 } | 1049 } |
| 1050 } | 1050 } |
| 1051 // No IPv4 address found on the interface. | 1051 // No IPv4 address found on the interface. |
| 1052 throw new SocketException( | 1052 throw new SocketException( |
| 1053 "The network interface does not have an address " | 1053 "The network interface does not have an address " |
| 1054 "of the same family as the multicast address"); | 1054 "of the same family as the multicast address"); |
| 1055 } else { | 1055 } else { |
| 1056 // Default to the ANY address if no iterface is specified. | 1056 // Default to the ANY address if no interface is specified. |
| 1057 return InternetAddress.ANY_IP_V4; | 1057 return InternetAddress.ANY_IP_V4; |
| 1058 } | 1058 } |
| 1059 } else { | 1059 } else { |
| 1060 return null; | 1060 return null; |
| 1061 } | 1061 } |
| 1062 } | 1062 } |
| 1063 | 1063 |
| 1064 void joinMulticast(InternetAddress addr, NetworkInterface interface) { | 1064 void joinMulticast(InternetAddress addr, NetworkInterface interface) { |
| 1065 var interfaceAddr = multicastAddress(addr, interface); | 1065 var interfaceAddr = multicastAddress(addr, interface); |
| 1066 var interfaceIndex = interface == null ? 0 : interface.index; | 1066 var interfaceIndex = interface == null ? 0 : interface.index; |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1829 } else { | 1829 } else { |
| 1830 _socket.close(); | 1830 _socket.close(); |
| 1831 } | 1831 } |
| 1832 } | 1832 } |
| 1833 } | 1833 } |
| 1834 | 1834 |
| 1835 Datagram _makeDatagram( | 1835 Datagram _makeDatagram( |
| 1836 List<int> data, String address, List<int> in_addr, int port) { | 1836 List<int> data, String address, List<int> in_addr, int port) { |
| 1837 return new Datagram(data, new _InternetAddress(address, null, in_addr), port); | 1837 return new Datagram(data, new _InternetAddress(address, null, in_addr), port); |
| 1838 } | 1838 } |
| OLD | NEW |