| Index: sdk/lib/io/socket.dart
|
| diff --git a/sdk/lib/io/socket.dart b/sdk/lib/io/socket.dart
|
| index 1f733ba617383c527a422cc324222bb2d3eae860..bb39cd60c6f7d231a656f2e9ce14dff1882b8149 100644
|
| --- a/sdk/lib/io/socket.dart
|
| +++ b/sdk/lib/io/socket.dart
|
| @@ -4,7 +4,6 @@
|
|
|
| part of dart.io;
|
|
|
| -
|
| /**
|
| * [InternetAddressType] is the type an [InternetAddress]. Currently,
|
| * IP version 4 (IPv4) and IP version 6 (IPv6) are supported.
|
| @@ -29,17 +28,20 @@ class InternetAddressType {
|
| */
|
| String get name {
|
| switch (_value) {
|
| - case -1: return "ANY";
|
| - case 0: return "IP_V4";
|
| - case 1: return "IP_V6";
|
| - default: throw new ArgumentError("Invalid InternetAddress");
|
| + case -1:
|
| + return "ANY";
|
| + case 0:
|
| + return "IP_V4";
|
| + case 1:
|
| + return "IP_V6";
|
| + default:
|
| + throw new ArgumentError("Invalid InternetAddress");
|
| }
|
| }
|
|
|
| String toString() => "InternetAddressType: $name";
|
| }
|
|
|
| -
|
| /**
|
| * An internet address.
|
| *
|
| @@ -139,8 +141,8 @@ abstract class InternetAddress {
|
| * specified type. The order of the list can, and most likely will,
|
| * change over time.
|
| */
|
| - external static Future<List<InternetAddress>> lookup(
|
| - String host, {InternetAddressType type: InternetAddressType.ANY});
|
| + external static Future<List<InternetAddress>> lookup(String host,
|
| + {InternetAddressType type: InternetAddressType.ANY});
|
|
|
| /**
|
| * Clones the given [address] with the new [host].
|
| @@ -152,7 +154,6 @@ abstract class InternetAddress {
|
| InternetAddress address, String host);
|
| }
|
|
|
| -
|
| /**
|
| * A [NetworkInterface] represents an active network interface on the current
|
| * system. It contains a list of [InternetAddress]es that are bound to the
|
| @@ -195,13 +196,12 @@ abstract class NetworkInterface {
|
| * [InternetAddressType.IP_V6] it will only lookup addresses of the
|
| * specified type. Default is [InternetAddressType.ANY].
|
| */
|
| - external static Future<List<NetworkInterface>> list({
|
| - bool includeLoopback: false,
|
| + external static Future<List<NetworkInterface>> list(
|
| + {bool includeLoopback: false,
|
| bool includeLinkLocal: false,
|
| InternetAddressType type: InternetAddressType.ANY});
|
| }
|
|
|
| -
|
| /**
|
| * A [RawServerSocket] represents a listening socket, and provides a
|
| * stream of low-level [RawSocket] objects, one for each connection
|
| @@ -247,11 +247,8 @@ abstract class RawServerSocket implements Stream<RawSocket> {
|
| * distributed among all the bound `RawServerSocket`s. Connections can be
|
| * distributed over multiple isolates this way.
|
| */
|
| - external static Future<RawServerSocket> bind(address,
|
| - int port,
|
| - {int backlog: 0,
|
| - bool v6Only: false,
|
| - bool shared: false});
|
| + external static Future<RawServerSocket> bind(address, int port,
|
| + {int backlog: 0, bool v6Only: false, bool shared: false});
|
|
|
| /**
|
| * Returns the port used by this socket.
|
| @@ -270,7 +267,6 @@ abstract class RawServerSocket implements Stream<RawSocket> {
|
| Future<RawServerSocket> close();
|
| }
|
|
|
| -
|
| /**
|
| * A [ServerSocket] represents a listening socket, and provides a
|
| * stream of [Socket] objects, one for each connection made to the
|
| @@ -316,11 +312,8 @@ abstract class ServerSocket implements Stream<Socket> {
|
| * distributed among all the bound `ServerSocket`s. Connections can be
|
| * distributed over multiple isolates this way.
|
| */
|
| - external static Future<ServerSocket> bind(address,
|
| - int port,
|
| - {int backlog: 0,
|
| - bool v6Only: false,
|
| - bool shared: false});
|
| + external static Future<ServerSocket> bind(address, int port,
|
| + {int backlog: 0, bool v6Only: false, bool shared: false});
|
|
|
| /**
|
| * Returns the port used by this socket.
|
| @@ -339,7 +332,6 @@ abstract class ServerSocket implements Stream<Socket> {
|
| Future<ServerSocket> close();
|
| }
|
|
|
| -
|
| /**
|
| * The [SocketDirection] is used as a parameter to [Socket.close] and
|
| * [RawSocket.close] to close a socket in the specified direction(s).
|
| @@ -389,10 +381,12 @@ class RawSocketEvent {
|
|
|
| const RawSocketEvent._(this._value);
|
| String toString() {
|
| - return const ['RawSocketEvent:READ',
|
| - 'RawSocketEvent:WRITE',
|
| - 'RawSocketEvent:READ_CLOSED',
|
| - 'RawSocketEvent:CLOSED'][_value];
|
| + return const [
|
| + 'RawSocketEvent:READ',
|
| + 'RawSocketEvent:WRITE',
|
| + 'RawSocketEvent:READ_CLOSED',
|
| + 'RawSocketEvent:CLOSED'
|
| + ][_value];
|
| }
|
| }
|
|
|
| @@ -574,7 +568,6 @@ abstract class Socket implements Stream<List<int>>, IOSink {
|
| Future<Socket> get done;
|
| }
|
|
|
| -
|
| /**
|
| * Datagram package. Data send to and received from datagram sockets
|
| * contains the internet address and port of the destination or source
|
| @@ -588,7 +581,6 @@ class Datagram {
|
| Datagram(this.data, this.address, this.port);
|
| }
|
|
|
| -
|
| /**
|
| * The [RawDatagramSocket] is a low-level interface to an UDP socket,
|
| * exposing the raw events signaled by the system. It's a [Stream] of
|
| @@ -655,8 +647,8 @@ abstract class RawDatagramSocket extends Stream<RawSocketEvent> {
|
| * Creates a new raw datagram socket binding it to an address and
|
| * port.
|
| */
|
| - external static Future<RawDatagramSocket> bind(
|
| - host, int port, {bool reuseAddress: true});
|
| + external static Future<RawDatagramSocket> bind(host, int port,
|
| + {bool reuseAddress: true});
|
|
|
| /**
|
| * Returns the port used by this socket.
|
| @@ -706,7 +698,6 @@ abstract class RawDatagramSocket extends Stream<RawSocketEvent> {
|
| void leaveMulticast(InternetAddress group, [NetworkInterface interface]);
|
| }
|
|
|
| -
|
| class SocketException implements IOException {
|
| final String message;
|
| final OSError osError;
|
|
|