StringTokenizer 복구
This commit is contained in:
2
Server/include/ServerController.hpp
Normal file
2
Server/include/ServerController.hpp
Normal file
@@ -0,0 +1,2 @@
|
||||
#pragma once
|
||||
|
||||
@@ -16,23 +16,20 @@ int main() {
|
||||
|
||||
struct Chattr::TCPSocket sock;
|
||||
struct Chattr::Address serveraddr;
|
||||
struct Chattr::TCPSocket clientSock;
|
||||
struct Chattr::Address clientAddr;
|
||||
if (config.ipVersion == 4) {
|
||||
sock.init(AF_INET);
|
||||
serveraddr.set(AF_INET, INADDR_ANY, config.listenPort);
|
||||
clientAddr.setType(AF_INET);
|
||||
}
|
||||
else if (config.ipVersion == 6) {
|
||||
sock.init(AF_INET6);
|
||||
serveraddr.set(AF_INET6, in6addr_any, config.listenPort);
|
||||
clientAddr.setType(AF_INET6);
|
||||
}
|
||||
sock.bind(&serveraddr.addr, serveraddr.length);
|
||||
sock.listen(SOMAXCONN);
|
||||
struct Chattr::TCPSocket clientSock;
|
||||
struct Chattr::Address clientAddr;
|
||||
|
||||
if (config.ipVersion == 4)
|
||||
clientAddr.length = sizeof(sockaddr_in);
|
||||
else
|
||||
clientAddr.length = sizeof(sockaddr_in6);
|
||||
|
||||
while (true) {
|
||||
spdlog::info("Waiting for connection...");
|
||||
|
||||
Reference in New Issue
Block a user