8f66cc9827
(cherry picked from commit ac11197a4b0af00833114ec400df2bca07e874e3)
25 lines
357 B
D
25 lines
357 B
D
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();
|
|
});
|
|
}
|