Skip to content

Commit

Permalink
Add test for issue #1441.
Browse files Browse the repository at this point in the history
(cherry picked from commit ac11197)
  • Loading branch information
s-ludwig committed Feb 27, 2016
1 parent f54f337 commit 60fec44
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/vibe.core.net.1441/dub.sdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name "tests"
description "TCP disconnect task issue"
dependency "vibe-d:core" path="../../"
versions "VibeDefaultMain"
24 changes: 24 additions & 0 deletions tests/vibe.core.net.1441/source/app.d
Original file line number Diff line number Diff line change
@@ -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();
});
}

0 comments on commit 60fec44

Please sign in to comment.