Skip to content

Commit

Permalink
fix test-cases using IPv6
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinNowak committed Feb 23, 2018
1 parent 2de64a0 commit 8e5c4a1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/tcpproxy/source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ void testProtocol(TCPConnection server, bool terminate)

void runTest()
{
import std.algorithm : find;
import std.socket : AddressFamily;

// server for a simple line based protocol
auto l1 = listenTCP(0, (client) {
while (!client.empty) {
Expand All @@ -50,7 +53,7 @@ void runTest()

client.write(format("Hash: %08X\r\n", typeid(string).getHash(&ln)));
}
})[0];
}).find!(l => l.bindAddress.family == AddressFamily.INET).front;
scope (exit) l1.stopListening;

// proxy server
Expand All @@ -71,7 +74,7 @@ void runTest()
}
server.write(client);
logInfo("Proxy out");
})[0];
}).find!(l => l.bindAddress.family == AddressFamily.INET).front;
scope (exit) l2.stopListening;

// test server
Expand Down

0 comments on commit 8e5c4a1

Please sign in to comment.