On Fri, 17 Apr 2015 10:10:03 +0200, Sönke Ludwig wrote:

Am 17.04.2015 um 07:46 schrieb doge:

Example of an echo server from vibed.org:

import vibe.d;

shared static this()
{
     listenTCP(7000, (conn) { conn.write(conn); });
}

It works for me. But if I am trying to add this ctor to one my project it isn't work: it listens and allows to connect, but delegate isn't executed (checked by assert(false) at first line of it). And after killing of this process it just releases connected socket by disconnecting client (telnet has been used as client).

What could be the problem?

Sounds like no event loop may be running. Do you use your own main

Yes, but also I am practice unittests-only executions ("dub test")

function, or call some kind of indefinitely blocking function before
leaving static this?

Hmm... My shared static this(){} contains only one line, as an example above.

What is "blocking" in this context? Do I understand correctly that listenTCP is launching an independent thread for listening?