From 1d88fb755cecf12c607bd2bf1b9e9226eade4690 Mon Sep 17 00:00:00 2001 From: Anonymous275 Date: Wed, 17 Jun 2020 23:18:52 +0300 Subject: [PATCH] added exeption handeling --- src/CoreNetwork.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/CoreNetwork.cpp b/src/CoreNetwork.cpp index 1b85452..2fd2be1 100644 --- a/src/CoreNetwork.cpp +++ b/src/CoreNetwork.cpp @@ -100,7 +100,14 @@ bool once = false; } // Setup the TCP listening socket - iResult = bind(ListenSocket, result->ai_addr, (int)result->ai_addrlen); + try{ + + 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(MPDEV)Exit("(Core) bind failed with error: " + std::to_string(WSAGetLastError())); freeaddrinfo(result);