| Index: runtime/bin/socket_patch.dart
|
| diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
|
| index 3caf14806bc3f7f152d4248485e0a1a3ce8479a9..7c3069a7a0c8e7e710eda4abbf059952c453eea2 100644
|
| --- a/runtime/bin/socket_patch.dart
|
| +++ b/runtime/bin/socket_patch.dart
|
| @@ -104,6 +104,8 @@ class _InternetAddress implements InternetAddress {
|
| }
|
| }
|
|
|
| + Future<InternetAddress> reverse() => _NativeSocket.reverseLookup(this);
|
| +
|
| _InternetAddress(InternetAddressType this.type,
|
| String this.address,
|
| String this.host,
|
| @@ -191,6 +193,7 @@ class _NativeSocket extends NativeFieldWrapperClass1 {
|
| // Native port messages.
|
| static const HOST_NAME_LOOKUP = 0;
|
| static const LIST_INTERFACES = 1;
|
| + static const REVERSE_LOOKUP = 2;
|
|
|
| // Socket close state
|
| bool isClosed = false;
|
| @@ -234,6 +237,18 @@ class _NativeSocket extends NativeFieldWrapperClass1 {
|
| });
|
| }
|
|
|
| + static Future<InternetAddress> reverseLookup(InternetAddress addr) {
|
| + ensureSocketService();
|
| + return socketService.call([REVERSE_LOOKUP, addr._sockaddr_storage])
|
| + .then((response) {
|
| + if (isErrorResponse(response)) {
|
| + throw createError(response, "Failed host name lookup");
|
| + } else {
|
| + return addr._cloneWithNewHost(response);
|
| + }
|
| + });
|
| + }
|
| +
|
| static Future<List<NetworkInterface>> listInterfaces({
|
| bool includeLoopback: false,
|
| bool includeLinkLocal: false,
|
|
|