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(); + }); +}