Update InternetAddress.rawAddress to be Uint8List
Bug: https://github.com/dart-lang/sdk/issues/36900
Change-Id: I7ca3ddb22fb09e9b85eb15c6185b21c036b241a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104521
Commit-Queue: Todd Volkert <tvolkert@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
index 4a87275..eb01395 100644
--- a/runtime/bin/socket_patch.dart
+++ b/runtime/bin/socket_patch.dart
@@ -144,7 +144,7 @@
String get host => _host != null ? _host : address;
- List<int> get rawAddress => new Uint8List.fromList(_in_addr);
+ Uint8List get rawAddress => new Uint8List.fromList(_in_addr);
bool get isLoopback {
switch (type) {
@@ -1177,15 +1177,15 @@
nativeRecvFrom() native "Socket_RecvFrom";
nativeWrite(List<int> buffer, int offset, int bytes)
native "Socket_WriteList";
- nativeSendTo(List<int> buffer, int offset, int bytes, List<int> address,
+ nativeSendTo(List<int> buffer, int offset, int bytes, Uint8List address,
int port) native "Socket_SendTo";
- nativeCreateConnect(List<int> addr, int port) native "Socket_CreateConnect";
- nativeCreateBindConnect(List<int> addr, int port, List<int> sourceAddr)
+ nativeCreateConnect(Uint8List addr, int port) native "Socket_CreateConnect";
+ nativeCreateBindConnect(Uint8List addr, int port, Uint8List sourceAddr)
native "Socket_CreateBindConnect";
bool isBindError(int errorNumber) native "SocketBase_IsBindError";
- nativeCreateBindListen(List<int> addr, int port, int backlog, bool v6Only,
+ nativeCreateBindListen(Uint8List addr, int port, int backlog, bool v6Only,
bool shared) native "ServerSocket_CreateBindListen";
- nativeCreateBindDatagram(List<int> addr, int port, bool reuseAddress,
+ nativeCreateBindDatagram(Uint8List addr, int port, bool reuseAddress,
bool reusePort, int ttl) native "Socket_CreateBindDatagram";
nativeAccept(_NativeSocket socket) native "ServerSocket_Accept";
int nativeGetPort() native "Socket_GetPort";
@@ -1199,9 +1199,9 @@
native "Socket_SetOption";
OSError nativeSetRawOption(int level, int option, Uint8List data)
native "Socket_SetRawOption";
- OSError nativeJoinMulticast(List<int> addr, List<int> interfaceAddr,
+ OSError nativeJoinMulticast(Uint8List addr, Uint8List interfaceAddr,
int interfaceIndex) native "Socket_JoinMulticast";
- bool nativeLeaveMulticast(List<int> addr, List<int> interfaceAddr,
+ bool nativeLeaveMulticast(Uint8List addr, Uint8List interfaceAddr,
int interfaceIndex) native "Socket_LeaveMulticast";
}
@@ -1985,6 +1985,6 @@
@pragma("vm:entry-point", "call")
Datagram _makeDatagram(
- List<int> data, String address, List<int> in_addr, int port) {
+ List<int> data, String address, Uint8List in_addr, int port) {
return new Datagram(data, new _InternetAddress(address, null, in_addr), port);
}
diff --git a/sdk/lib/io/socket.dart b/sdk/lib/io/socket.dart
index fdf6bbd..cb0f78c 100644
--- a/sdk/lib/io/socket.dart
+++ b/sdk/lib/io/socket.dart
@@ -115,7 +115,7 @@
* 4 or 16 byte long list. The returned list is a copy, making it possible
* to change the list without modifying the [InternetAddress].
*/
- List<int> get rawAddress;
+ Uint8List get rawAddress;
/**
* Returns true if the [InternetAddress] is a loopback address.