| Index: runtime/bin/socket_patch.dart
|
| diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
|
| index 51d67616837c26b0b5621d98fa67e42b2cbe77f9..32a869351716feea9991bb45a78d7c4bec1f88c9 100644
|
| --- a/runtime/bin/socket_patch.dart
|
| +++ b/runtime/bin/socket_patch.dart
|
| @@ -5,8 +5,9 @@
|
| patch class RawServerSocket {
|
| /* patch */ static Future<RawServerSocket> bind(address,
|
| int port,
|
| - {int backlog: 0}) {
|
| - return _RawServerSocket.bind(address, port, backlog);
|
| + {int backlog: 0,
|
| + bool v6Only: false}) {
|
| + return _RawServerSocket.bind(address, port, backlog, v6Only);
|
| }
|
| }
|
|
|
| @@ -215,7 +216,8 @@ class _NativeSocket extends NativeFieldWrapperClass1 {
|
|
|
| static Future<_NativeSocket> bind(host,
|
| int port,
|
| - int backlog) {
|
| + int backlog,
|
| + bool v6Only) {
|
| return new Future.value(host)
|
| .then((host) {
|
| if (host is _InternetAddress) return host;
|
| @@ -232,7 +234,8 @@ class _NativeSocket extends NativeFieldWrapperClass1 {
|
| socket.address = address;
|
| var result = socket.nativeCreateBindListen(address._sockaddr_storage,
|
| port,
|
| - backlog);
|
| + backlog,
|
| + v6Only);
|
| if (result is OSError) {
|
| throw new SocketIOException(
|
| "Failed to create server socket", result);
|
| @@ -526,7 +529,7 @@ class _NativeSocket extends NativeFieldWrapperClass1 {
|
| native "Socket_WriteList";
|
| nativeCreateConnect(List<int> addr,
|
| int port) native "Socket_CreateConnect";
|
| - nativeCreateBindListen(List<int> addr, int port, int backlog)
|
| + nativeCreateBindListen(List<int> addr, int port, int backlog, bool v6Only)
|
| native "ServerSocket_CreateBindListen";
|
| nativeAccept(_NativeSocket socket) native "ServerSocket_Accept";
|
| int nativeGetPort() native "Socket_GetPort";
|
| @@ -545,11 +548,12 @@ class _RawServerSocket extends Stream<RawSocket>
|
|
|
| static Future<_RawServerSocket> bind(address,
|
| int port,
|
| - int backlog) {
|
| + int backlog,
|
| + bool v6Only) {
|
| if (port < 0 || port > 0xFFFF)
|
| throw new ArgumentError("Invalid port $port");
|
| if (backlog < 0) throw new ArgumentError("Invalid backlog $backlog");
|
| - return _NativeSocket.bind(address, port, backlog)
|
| + return _NativeSocket.bind(address, port, backlog, v6Only)
|
| .then((socket) => new _RawServerSocket(socket));
|
| }
|
|
|
| @@ -602,6 +606,7 @@ class _RawServerSocket extends Stream<RawSocket>
|
| close();
|
| }
|
| }
|
| +
|
| void _onPauseStateChange() {
|
| if (_controller.isPaused) {
|
| _pause();
|
| @@ -739,8 +744,9 @@ class _RawSocket extends Stream<RawSocketEvent>
|
| patch class ServerSocket {
|
| /* patch */ static Future<ServerSocket> bind(address,
|
| int port,
|
| - {int backlog: 0}) {
|
| - return _ServerSocket.bind(address, port, backlog);
|
| + {int backlog: 0,
|
| + bool v6Only: false}) {
|
| + return _ServerSocket.bind(address, port, backlog, v6Only);
|
| }
|
| }
|
|
|
| @@ -750,8 +756,9 @@ class _ServerSocket extends Stream<Socket>
|
|
|
| static Future<_ServerSocket> bind(address,
|
| int port,
|
| - int backlog) {
|
| - return _RawServerSocket.bind(address, port, backlog)
|
| + int backlog,
|
| + bool v6Only) {
|
| + return _RawServerSocket.bind(address, port, backlog, v6Only)
|
| .then((socket) => new _ServerSocket(socket));
|
| }
|
|
|
|
|