2 TC Server bugs

pull/3/head
Tom Early 2 years ago
parent 45cf750bdd
commit a46e900121

@ -70,7 +70,10 @@ bool CReflector::Start(void)
// init transcoder comms // init transcoder comms
if (port) if (port)
g_TCServer.Open(g_Configure.GetString(g_Keys.tc.bind), tcmods, port); {
if (g_TCServer.Open(g_Configure.GetString(g_Keys.tc.bind), tcmods, port))
return true;
}
// init gate keeper. It can only return true! // init gate keeper. It can only return true!
g_GateKeeper.Init(); g_GateKeeper.Init();

@ -248,7 +248,7 @@ bool CTCServer::Accept()
while (any_are_closed()) while (any_are_closed())
{ {
if (acceptone()) if (acceptone(fd))
return true; return true;
} }
@ -257,13 +257,13 @@ bool CTCServer::Accept()
return false; return false;
} }
bool CTCServer::acceptone() bool CTCServer::acceptone(int fd)
{ {
CIp their_addr; // connector's address information CIp their_addr; // connector's address information
socklen_t sin_size = sizeof(struct sockaddr_storage); socklen_t sin_size = sizeof(struct sockaddr_storage);
auto newfd = accept(m_Pfd.back().fd, their_addr.GetPointer(), &sin_size); auto newfd = accept(fd, their_addr.GetPointer(), &sin_size);
if (newfd < 0) if (newfd < 0)
{ {
perror("Accept accept"); perror("Accept accept");

@ -62,7 +62,7 @@ public:
private: private:
CIp m_Ip; CIp m_Ip;
bool any_are_closed(); bool any_are_closed();
bool acceptone(); bool acceptone(int fd);
}; };
class CTCClient : public CTCSocket class CTCClient : public CTCSocket

Loading…
Cancel
Save

Powered by TurnKey Linux.