cSocket: final localhost fix - made it a function (forgotten file)

git-svn-id: http://mc-server.googlecode.com/svn/trunk@243 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com 2012-02-07 21:16:34 +00:00
parent 21f758c9c0
commit dcd82b6988

View File

@ -279,7 +279,7 @@ bool cSocketThreads::cSocketThread::Start(void)
} }
cSocket::SockAddr_In Addr; cSocket::SockAddr_In Addr;
Addr.Family = cSocket::ADDRESS_FAMILY_INTERNET; Addr.Family = cSocket::ADDRESS_FAMILY_INTERNET;
Addr.Address = cSocket::INTERNET_ADDRESS_LOCALHOST; Addr.Address = cSocket::INTERNET_ADDRESS_LOCALHOST();
Addr.Port = 0; // Any free port is okay Addr.Port = 0; // Any free port is okay
if (m_ControlSocket1.Bind(Addr) != 0) if (m_ControlSocket1.Bind(Addr) != 0)
{ {
@ -324,7 +324,7 @@ void cSocketThreads::cSocketThread::Execute(void)
// Connect the "client" part of the Control socket: // Connect the "client" part of the Control socket:
cSocket::SockAddr_In Addr; cSocket::SockAddr_In Addr;
Addr.Family = cSocket::ADDRESS_FAMILY_INTERNET; Addr.Family = cSocket::ADDRESS_FAMILY_INTERNET;
Addr.Address = cSocket::INTERNET_ADDRESS_LOCALHOST; Addr.Address = cSocket::INTERNET_ADDRESS_LOCALHOST();
Addr.Port = m_ControlSocket1.GetPort(); Addr.Port = m_ControlSocket1.GetPort();
assert(Addr.Port != 0); // We checked in the Start() method, but let's be sure assert(Addr.Port != 0); // We checked in the Start() method, but let's be sure
if (m_ControlSocket2.Connect(Addr) != 0) if (m_ControlSocket2.Connect(Addr) != 0)
@ -464,7 +464,7 @@ void cSocketThreads::cSocketThread::WriteToSockets(fd_set * a_Write)
return; return;
} }
m_Slots[i].m_Outgoing.erase(0, Sent); m_Slots[i].m_Outgoing.erase(0, Sent);
} } // for i - m_Slots[i]
} }