summaryrefslogtreecommitdiff
path: root/src/server.cpp
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-03-10 18:36:00 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-03-20 23:44:58 +0800
commit131dc244e67e3b6e9304e7076c397c761860044c (patch)
tree56f634c1a16c4e5b6eb2224ba876ca97f68e4dee /src/server.cpp
parent4e8644b8ab3b259a91387c93a3295092bd9757a0 (diff)
fix(registerName): no longer allow same name
the previous behaviour was it wouldn't broadcast the message to the same name debug: more logging, maybe we should disable TRACE by default in the future? WIP: partial impl of signal handling(SIGINT(keyboardinterrupt) etc)
Diffstat (limited to 'src/server.cpp')
-rw-r--r--src/server.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/server.cpp b/src/server.cpp
index cfe13c5..dbf48a7 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -2,6 +2,7 @@
#include <cstring>
#include <print>
#include <sys/socket.h>
+#include "log.hpp"
CServer::CServer(uint16_t port)
: m_sockfd(Hyprutils::OS::CFileDescriptor{socket(AF_INET, SOCK_STREAM, 0)}) {
@@ -20,10 +21,13 @@ CServer::CServer(uint16_t port)
listen(m_sockfd.get(), 5)
? throw std::runtime_error("Failed to bind or listen")
: std::println("Server started on port: {}", port);
+
+ log(LOG, "Server: initialized");
};
CServer::~CServer() {
m_sockfd.reset();
+ log(SYS, "Server: bye");
}
Hyprutils::OS::CFileDescriptor *CServer::getSocket() {