I found the problem. Server won't close the connection if I sent a message.

If I add

if(socket.dataAvailableForRead) {
    auto msg = socket.receiveText();
    logInfo("Received: ", msg);
}

I get:

Task terminated with unhandled exception: Acquiring reader of already owned connection.
Error executing command run: Program exited with code -11

So I need something like in the broadcast example, according to http://forum.rejectedsoftware.com/groups/rejectedsoftware.vibed/thread/566/