summaryrefslogtreecommitdiff
path: root/Userland/Services/EchoServer
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2021-12-25 14:59:40 +0000
committerAndreas Kling <kling@serenityos.org>2021-12-27 22:00:01 +0100
commit8600d89407e8e59263ad788a84a3de2798a8f554 (patch)
tree0acfece3afae353ffadf4326dc6b450cc0b730ea /Userland/Services/EchoServer
parent143f820c68e3d15d8864211eb51d1e2c2548937b (diff)
downloadserenity-8600d89407e8e59263ad788a84a3de2798a8f554.zip
LibCore+Services: Make TCPServer propagate errors
Diffstat (limited to 'Userland/Services/EchoServer')
-rw-r--r--Userland/Services/EchoServer/main.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/Userland/Services/EchoServer/main.cpp b/Userland/Services/EchoServer/main.cpp
index 5a7db00aa5..50eb7fa948 100644
--- a/Userland/Services/EchoServer/main.cpp
+++ b/Userland/Services/EchoServer/main.cpp
@@ -31,12 +31,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
Core::EventLoop event_loop;
- auto server = Core::TCPServer::construct();
-
- if (!server->listen({}, port)) {
- warnln("Listening on 0.0.0.0:{} failed", port);
- exit(1);
- }
+ auto server = TRY(Core::TCPServer::try_create());
+ TRY(server->listen({}, port));
HashMap<int, NonnullRefPtr<Client>> clients;
int next_id = 0;