diff options
author | Mattes D <github@xoft.cz> | 2016-08-25 09:04:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-25 09:04:17 +0200 |
commit | d52afadad491474f63e8184cb5a08c0ca21ab48c (patch) | |
tree | d5afab6035ca6bb0b58fd03ad5cfe3b3f8e1da55 /Tools/ProtoProxy/Server.cpp | |
parent | Merge pull request #3342 from cuberite/FixEmptyHeader (diff) | |
parent | Fixed type-casting-related warnings. (diff) | |
download | cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.tar cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.tar.gz cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.tar.bz2 cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.tar.lz cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.tar.xz cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.tar.zst cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.zip |
Diffstat (limited to 'Tools/ProtoProxy/Server.cpp')
-rw-r--r-- | Tools/ProtoProxy/Server.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Tools/ProtoProxy/Server.cpp b/Tools/ProtoProxy/Server.cpp index 98baec8da..60998798c 100644 --- a/Tools/ProtoProxy/Server.cpp +++ b/Tools/ProtoProxy/Server.cpp @@ -20,7 +20,7 @@ cServer::cServer(void) -int cServer::Init(short a_ListenPort, short a_ConnectPort) +int cServer::Init(UInt16 a_ListenPort, UInt16 a_ConnectPort) { m_ConnectPort = a_ConnectPort; @@ -50,7 +50,7 @@ int cServer::Init(short a_ListenPort, short a_ConnectPort) local.sin_family = AF_INET; local.sin_addr.s_addr = INADDR_ANY; // All interfaces local.sin_port = htons(a_ListenPort); - if (bind(m_ListenSocket, (sockaddr *)&local, sizeof(local)) != 0) + if (bind(m_ListenSocket, reinterpret_cast<const sockaddr *>(&local), sizeof(local)) != 0) { #ifdef _WIN32 int err = WSAGetLastError(); @@ -70,7 +70,7 @@ int cServer::Init(short a_ListenPort, short a_ConnectPort) printf("Failed to listen on socket: %d\n", err); return err; } - LOGINFO("Listening on port %d, connecting to localhost:%d", a_ListenPort, a_ConnectPort); + LOGINFO("Listening for client connections on port %d, connecting to server at localhost:%d", a_ListenPort, a_ConnectPort); LOGINFO("Generating protocol encryption keypair..."); m_PrivateKey.Generate(); @@ -91,7 +91,7 @@ void cServer::Run(void) sockaddr_in Addr; memset(&Addr, 0, sizeof(Addr)); socklen_t AddrSize = sizeof(Addr); - SOCKET client = accept(m_ListenSocket, (sockaddr *)&Addr, &AddrSize); + SOCKET client = accept(m_ListenSocket, reinterpret_cast<sockaddr *>(&Addr), &AddrSize); if (client == INVALID_SOCKET) { printf("accept returned an error: %d; bailing out.\n", SocketError); |