From 8f66cc9827da59bf945c32c5f26ab477b1f1d442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Fri, 26 Feb 2016 21:59:40 +0100 Subject: [PATCH] Add test for issue #1441. (cherry picked from commit ac11197a4b0af00833114ec400df2bca07e874e3) --- tests/vibe.core.net.1441/dub.sdl | 4 ++++ tests/vibe.core.net.1441/source/app.d | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 tests/vibe.core.net.1441/dub.sdl create mode 100644 tests/vibe.core.net.1441/source/app.d diff --git a/tests/vibe.core.net.1441/dub.sdl b/tests/vibe.core.net.1441/dub.sdl new file mode 100644 index 0000000..5df5ea8 --- /dev/null +++ b/tests/vibe.core.net.1441/dub.sdl @@ -0,0 +1,4 @@ +name "tests" +description "TCP disconnect task issue" +dependency "vibe-d:core" path="../../" +versions "VibeDefaultMain" diff --git a/tests/vibe.core.net.1441/source/app.d b/tests/vibe.core.net.1441/source/app.d new file mode 100644 index 0000000..d3ddc06 --- /dev/null +++ b/tests/vibe.core.net.1441/source/app.d @@ -0,0 +1,24 @@ +import vibe.core.core; +import vibe.core.net; +import core.time : msecs; + +shared static this() +{ + import vibe.core.log; + bool done = false; + listenTCP(11375,(conn){ + conn.write("foo"); + conn.close(); + done = true; + }); + + runTask({ + auto conn = connectTCP("127.0.0.1", 11375); + conn.close(); + + sleep(50.msecs); + assert(done); + + exitEventLoop(); + }); +}