Skip to content

Commit bd84cff

Browse files
tvolkertcommit-bot@chromium.org
authored andcommitted
Update InternetAddress.rawAddress to be Uint8List
Bug: #36900 Change-Id: I7ca3ddb22fb09e9b85eb15c6185b21c036b241a3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104521 Commit-Queue: Todd Volkert <[email protected]> Reviewed-by: Lasse R.H. Nielsen <[email protected]>
1 parent a600e97 commit bd84cff

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

runtime/bin/socket_patch.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class _InternetAddress implements InternetAddress {
144144

145145
String get host => _host != null ? _host : address;
146146

147-
List<int> get rawAddress => new Uint8List.fromList(_in_addr);
147+
Uint8List get rawAddress => new Uint8List.fromList(_in_addr);
148148

149149
bool get isLoopback {
150150
switch (type) {
@@ -1177,15 +1177,15 @@ class _NativeSocket extends _NativeSocketNativeWrapper with _ServiceObject {
11771177
nativeRecvFrom() native "Socket_RecvFrom";
11781178
nativeWrite(List<int> buffer, int offset, int bytes)
11791179
native "Socket_WriteList";
1180-
nativeSendTo(List<int> buffer, int offset, int bytes, List<int> address,
1180+
nativeSendTo(List<int> buffer, int offset, int bytes, Uint8List address,
11811181
int port) native "Socket_SendTo";
1182-
nativeCreateConnect(List<int> addr, int port) native "Socket_CreateConnect";
1183-
nativeCreateBindConnect(List<int> addr, int port, List<int> sourceAddr)
1182+
nativeCreateConnect(Uint8List addr, int port) native "Socket_CreateConnect";
1183+
nativeCreateBindConnect(Uint8List addr, int port, Uint8List sourceAddr)
11841184
native "Socket_CreateBindConnect";
11851185
bool isBindError(int errorNumber) native "SocketBase_IsBindError";
1186-
nativeCreateBindListen(List<int> addr, int port, int backlog, bool v6Only,
1186+
nativeCreateBindListen(Uint8List addr, int port, int backlog, bool v6Only,
11871187
bool shared) native "ServerSocket_CreateBindListen";
1188-
nativeCreateBindDatagram(List<int> addr, int port, bool reuseAddress,
1188+
nativeCreateBindDatagram(Uint8List addr, int port, bool reuseAddress,
11891189
bool reusePort, int ttl) native "Socket_CreateBindDatagram";
11901190
nativeAccept(_NativeSocket socket) native "ServerSocket_Accept";
11911191
int nativeGetPort() native "Socket_GetPort";
@@ -1199,9 +1199,9 @@ class _NativeSocket extends _NativeSocketNativeWrapper with _ServiceObject {
11991199
native "Socket_SetOption";
12001200
OSError nativeSetRawOption(int level, int option, Uint8List data)
12011201
native "Socket_SetRawOption";
1202-
OSError nativeJoinMulticast(List<int> addr, List<int> interfaceAddr,
1202+
OSError nativeJoinMulticast(Uint8List addr, Uint8List interfaceAddr,
12031203
int interfaceIndex) native "Socket_JoinMulticast";
1204-
bool nativeLeaveMulticast(List<int> addr, List<int> interfaceAddr,
1204+
bool nativeLeaveMulticast(Uint8List addr, Uint8List interfaceAddr,
12051205
int interfaceIndex) native "Socket_LeaveMulticast";
12061206
}
12071207

@@ -1985,6 +1985,6 @@ class _RawDatagramSocket extends Stream<RawSocketEvent>
19851985

19861986
@pragma("vm:entry-point", "call")
19871987
Datagram _makeDatagram(
1988-
List<int> data, String address, List<int> in_addr, int port) {
1988+
List<int> data, String address, Uint8List in_addr, int port) {
19891989
return new Datagram(data, new _InternetAddress(address, null, in_addr), port);
19901990
}

sdk/lib/io/socket.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ abstract class InternetAddress {
115115
* 4 or 16 byte long list. The returned list is a copy, making it possible
116116
* to change the list without modifying the [InternetAddress].
117117
*/
118-
List<int> get rawAddress;
118+
Uint8List get rawAddress;
119119

120120
/**
121121
* Returns true if the [InternetAddress] is a loopback address.

0 commit comments

Comments
 (0)