vibe-core/examples/echo-server/source/app.d

15 lines
291 B
D
Raw Normal View History

2017-09-21 12:08:52 +00:00
import vibe.core.core : runApplication;
2020-08-20 02:57:07 +00:00
import vibe.core.log;
2017-09-21 12:08:52 +00:00
import vibe.core.net : listenTCP;
import vibe.core.stream : pipe;
void main()
{
2020-08-20 02:57:07 +00:00
listenTCP(7000, (conn) @safe nothrow {
try pipe(conn, conn);
catch (Exception e)
logError("Error: %s", e.msg);
});
2017-09-21 12:08:52 +00:00
runApplication();
}