mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:17:35 +00:00
LibCore+Services: Make TCPServer propagate errors
This commit is contained in:
parent
143f820c68
commit
8600d89407
6 changed files with 59 additions and 70 deletions
|
@ -97,12 +97,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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue