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>
This commit is contained in:
Todd Volkert 2019-06-20 06:35:35 +00:00 committed by commit-bot@chromium.org
parent a600e97cae
commit bd84cff2b1
2 changed files with 10 additions and 10 deletions

View file

@ -144,7 +144,7 @@ class _InternetAddress implements InternetAddress {
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 @@ class _NativeSocket extends _NativeSocketNativeWrapper with _ServiceObject {
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 @@ class _NativeSocket extends _NativeSocketNativeWrapper with _ServiceObject {
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 @@ class _RawDatagramSocket extends Stream<RawSocketEvent>
@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);
}

View file

@ -115,7 +115,7 @@ abstract class InternetAddress {
* 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.