From 968ac82c8d2997ab4c692d84c9d7c04484de8543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Sun, 15 Mar 2020 14:01:18 +0100 Subject: [PATCH] Use normal main() and avoid socket leak in test. --- tests/vibe.core.net.1376.d | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/vibe.core.net.1376.d b/tests/vibe.core.net.1376.d index 2d6529d..d9afb6f 100644 --- a/tests/vibe.core.net.1376.d +++ b/tests/vibe.core.net.1376.d @@ -2,7 +2,6 @@ name "tests" description "TCP disconnect task issue" dependency "vibe-core" path="../" - versions "VibeDefaultMain" +/ module test; @@ -10,7 +9,7 @@ import vibe.core.core; import vibe.core.net; import core.time : msecs; -shared static this() +void main() { auto l = listenTCP(0, (conn) { auto td = runTask!TCPConnection((conn) { @@ -39,4 +38,8 @@ shared static this() sleep(50.msecs); exitEventLoop(); }); + + runApplication(); + + l.stopListening(); }