First working alpha, version a0.4. #6
@@ -54,7 +54,7 @@ int main(int argc, char** argv) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
log("ColumnLynx Client, Version " + getVersion());
|
log("ColumnLynx Client, Version " + getVersion());
|
||||||
log("This software is licensed under the GPLv2 only OR the GPLv3. See LICENSE for details.");
|
log("This software is licensed under the GPLv2 only OR the GPLv3. See LICENSES/ for details.");
|
||||||
|
|
||||||
LibSodiumWrapper sodiumWrapper = LibSodiumWrapper();
|
LibSodiumWrapper sodiumWrapper = LibSodiumWrapper();
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ int main(int argc, char** argv) {
|
|||||||
|
|
||||||
// Client is running
|
// Client is running
|
||||||
// TODO: SIGINT or SIGTERM seems to not kill this instantly!
|
// TODO: SIGINT or SIGTERM seems to not kill this instantly!
|
||||||
while (client->isConnected() || !client->isHandshakeComplete() || !done) {
|
while ((client->isConnected() || !client->isHandshakeComplete()) && !done) {
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(100)); // Temp wait
|
std::this_thread::sleep_for(std::chrono::milliseconds(100)); // Temp wait
|
||||||
|
|
||||||
if (client->isHandshakeComplete()) {
|
if (client->isHandshakeComplete()) {
|
||||||
|
|||||||
@@ -18,26 +18,27 @@ using namespace ColumnLynx::Net::UDP;
|
|||||||
|
|
||||||
volatile sig_atomic_t done = 0;
|
volatile sig_atomic_t done = 0;
|
||||||
|
|
||||||
/*void signalHandler(int signum) {
|
void signalHandler(int signum) {
|
||||||
if (signum == SIGINT || signum == SIGTERM) {
|
if (signum == SIGINT || signum == SIGTERM) {
|
||||||
log("Received termination signal. Shutting down server gracefully.");
|
log("Received termination signal. Shutting down server gracefully.");
|
||||||
done = 1;
|
done = 1;
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
PanicHandler::init();
|
// Capture SIGINT and SIGTERM for graceful shutdown
|
||||||
|
struct sigaction action;
|
||||||
try {
|
|
||||||
// Catch SIGINT and SIGTERM for graceful shutdown
|
|
||||||
/*struct sigaction action;
|
|
||||||
memset(&action, 0, sizeof(struct sigaction));
|
memset(&action, 0, sizeof(struct sigaction));
|
||||||
action.sa_handler = signalHandler;
|
action.sa_handler = signalHandler;
|
||||||
sigaction(SIGINT, &action, nullptr);
|
sigaction(SIGINT, &action, nullptr);
|
||||||
sigaction(SIGTERM, &action, nullptr);*/
|
sigaction(SIGTERM, &action, nullptr);
|
||||||
|
|
||||||
|
PanicHandler::init();
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
log("ColumnLynx Server, Version " + getVersion());
|
log("ColumnLynx Server, Version " + getVersion());
|
||||||
log("This software is licensed under the GPLv2 only OR the GPLv3. See LICENSE for details.");
|
log("This software is licensed under the GPLv2 only OR the GPLv3. See LICENSES/ for details.");
|
||||||
|
|
||||||
// Generate a temporary keypair, replace with actual CA signed keys later (Note, these are stored in memory)
|
// Generate a temporary keypair, replace with actual CA signed keys later (Note, these are stored in memory)
|
||||||
LibSodiumWrapper sodiumWrapper = LibSodiumWrapper();
|
LibSodiumWrapper sodiumWrapper = LibSodiumWrapper();
|
||||||
|
|||||||
Reference in New Issue
Block a user