-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
34 lines (32 loc) · 1.25 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jfaye <jfaye@student.42lyon.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/11 20:26:46 by TheTerror #+# #+# */
/* Updated: 2024/05/30 18:20:32 by jfaye ### ########lyon.fr */
/* */
/* ************************************************************************** */
#include "./server/Server.hpp"
int main(int argc, char **argv)
{
signal(SIGINT, &exitServer);
if (argc != 3)
{
std::cerr << "Error: Expected ./ircserv <port> <password>" << std::endl;
return (1);
}
try
{
if (!Server::launchServer(argv[1], argv[2]))
return (1);
}
catch(const std::exception& e)
{
std::cerr << e.what() << std::endl;
return (1);
}
return (0);
}