[io/unix-domain-sockets] Ensure that receiver closes received socket.

Leaving socket unclosed results in server still running, test timing out.

This is follow-up to https://dart.googlesource.com/sdk/+/935ee25f3b72e7fe81047220cadae1f61c505da4

Fixes https://github.com/dart-lang/sdk/issues/47415

TEST=unix_socket_test on dartk bots

Change-Id: Ic99cd382059b42b36c84bc1bce3441cc2fd3bd46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216061
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
This commit is contained in:
Alexander Aprelev 2021-10-08 18:48:18 +00:00 committed by commit-bot@chromium.org
parent 3cb2d38723
commit 47f9067cad
2 changed files with 2 additions and 0 deletions

View file

@ -697,6 +697,7 @@ Future testSocketMessage(String uniqueName) async {
final receivedSocket = handles[0].toRawSocket();
receivedSocket.write('Hello, server!\n'.codeUnits);
socket.write('server replied'.codeUnits);
receivedSocket.close();
break;
case RawSocketEvent.readClosed:
socket.close();

View file

@ -693,6 +693,7 @@ Future testSocketMessage(String uniqueName) async {
final receivedSocket = handles[0].toRawSocket();
receivedSocket.write('Hello, server!\n'.codeUnits);
socket.write('server replied'.codeUnits);
receivedSocket.close();
break;
case RawSocketEvent.readClosed:
socket.close();