1
0
Fork 0
mirror of synced 2025-03-06 20:53:27 +01:00
mislaborate/server.cpp

21 lines
583 B
C++

#include "generic.pb.h"
#include "server/Connection.hpp"
#include "server/World.hpp"
#include <iostream>
#include <boost/asio.hpp>
int main() {
try {
boost::asio::io_context ioc;
Connection::Server server(ioc);
int port = 78432;
boost::asio::co_spawn(ioc, server.listen(port), boost::asio::detached);
std::cout << "Server has initialized and will now start listening on port " << port << '.' << std::endl;
ioc.run();
} catch (std::exception& e) {
std::cerr << "Failed to launch: " << e.what() << std::endl;
}
}