diff --git a/tests/vibe.core.net.1376.d b/tests/vibe.core.net.1376.d index 4e01fd9..2d6529d 100644 --- a/tests/vibe.core.net.1376.d +++ b/tests/vibe.core.net.1376.d @@ -12,7 +12,7 @@ import core.time : msecs; shared static this() { - listenTCP(11375,(conn){ + auto l = listenTCP(0, (conn) { auto td = runTask!TCPConnection((conn) { ubyte [3] buf; try { @@ -22,17 +22,17 @@ shared static this() }, conn); sleep(10.msecs); conn.close(); - }); + }, "127.0.0.1"); runTask({ try { - auto conn = connectTCP("127.0.0.1", 11375); + auto conn = connectTCP("127.0.0.1", l.bindAddress.port); conn.write("a"); conn.close(); } catch (Exception e) assert(false, e.msg); try { - auto conn = connectTCP("127.0.0.1", 11375); + auto conn = connectTCP("127.0.0.1", l.bindAddress.port); conn.close(); } catch (Exception e) assert(false, e.msg);