Add test for issue #1441.
(cherry picked from commit ac11197a4b0af00833114ec400df2bca07e874e3)
This commit is contained in:
parent
3a6583b375
commit
8f66cc9827
4
tests/vibe.core.net.1441/dub.sdl
Normal file
4
tests/vibe.core.net.1441/dub.sdl
Normal file
|
@ -0,0 +1,4 @@
|
|||
name "tests"
|
||||
description "TCP disconnect task issue"
|
||||
dependency "vibe-d:core" path="../../"
|
||||
versions "VibeDefaultMain"
|
24
tests/vibe.core.net.1441/source/app.d
Normal file
24
tests/vibe.core.net.1441/source/app.d
Normal file
|
@ -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();
|
||||
});
|
||||
}
|
Loading…
Reference in a new issue