This commit is contained in:
Anonymous275
2020-06-17 23:21:08 +03:00
parent 1d88fb755c
commit 3997eb089b
+6 -7
View File
@@ -57,6 +57,7 @@ std::string Parse(const std::string& Data){
bool once = false; bool once = false;
[[noreturn]] void MemoryInit(); [[noreturn]] void MemoryInit();
[[noreturn]] void CoreNetworkThread(){ [[noreturn]] void CoreNetworkThread(){
try {
std::cout << "Ready!" << std::endl; std::cout << "Ready!" << std::endl;
do { do {
if (MPDEV)std::cout << "Core Network on start!" << std::endl; if (MPDEV)std::cout << "Core Network on start!" << std::endl;
@@ -100,14 +101,7 @@ bool once = false;
} }
// Setup the TCP listening socket // Setup the TCP listening socket
try{
iResult = bind(ListenSocket, result->ai_addr, (int) result->ai_addrlen); iResult = bind(ListenSocket, result->ai_addr, (int) result->ai_addrlen);
} catch (std::exception&e) {
std::cout << "Exception! : " << e.what() << std::endl;
system("pause");
exit(1);
}
if (iResult == SOCKET_ERROR) { if (iResult == SOCKET_ERROR) {
if (MPDEV)Exit("(Core) bind failed with error: " + std::to_string(WSAGetLastError())); if (MPDEV)Exit("(Core) bind failed with error: " + std::to_string(WSAGetLastError()));
freeaddrinfo(result); freeaddrinfo(result);
@@ -171,4 +165,9 @@ bool once = false;
closesocket(ClientSocket); closesocket(ClientSocket);
WSACleanup(); WSACleanup();
} while (true); } while (true);
} catch (std::exception&e) {
std::cout << "Exception! : " << e.what() << std::endl;
system("pause");
exit(1);
}
} }