1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:57:35 +00:00

LibCore+Services: Make TCPServer propagate errors

This commit is contained in:
Sam Atkins 2021-12-25 14:59:40 +00:00 committed by Andreas Kling
parent 143f820c68
commit 8600d89407
6 changed files with 59 additions and 70 deletions

View file

@ -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;