From 59e3112e958a5ec76a723bbf219ee5435d1d4d45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Thu, 21 Sep 2017 14:08:52 +0200 Subject: [PATCH] Add echo server example. --- examples/echo-server/dub.sdl | 3 +++ examples/echo-server/source/app.d | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100644 examples/echo-server/dub.sdl create mode 100644 examples/echo-server/source/app.d diff --git a/examples/echo-server/dub.sdl b/examples/echo-server/dub.sdl new file mode 100644 index 0000000..8c18b2b --- /dev/null +++ b/examples/echo-server/dub.sdl @@ -0,0 +1,3 @@ +name "echo-server" +description "A simple echo protocol server implementation" +dependency "vibe-core" path="../../" diff --git a/examples/echo-server/source/app.d b/examples/echo-server/source/app.d new file mode 100644 index 0000000..aa0a7f7 --- /dev/null +++ b/examples/echo-server/source/app.d @@ -0,0 +1,9 @@ +import vibe.core.core : runApplication; +import vibe.core.net : listenTCP; +import vibe.core.stream : pipe; + +void main() +{ + listenTCP(7000, (conn) => pipe(conn, conn)); + runApplication(); +}