diff --git a/reflector/Reflector.cpp b/reflector/Reflector.cpp index 360a34c..1cfc3fc 100644 --- a/reflector/Reflector.cpp +++ b/reflector/Reflector.cpp @@ -70,7 +70,10 @@ bool CReflector::Start(void) // init transcoder comms 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! g_GateKeeper.Init(); diff --git a/reflector/TCSocket.cpp b/reflector/TCSocket.cpp index 3699dae..3b80521 100644 --- a/reflector/TCSocket.cpp +++ b/reflector/TCSocket.cpp @@ -248,7 +248,7 @@ bool CTCServer::Accept() while (any_are_closed()) { - if (acceptone()) + if (acceptone(fd)) return true; } @@ -257,13 +257,13 @@ bool CTCServer::Accept() return false; } -bool CTCServer::acceptone() +bool CTCServer::acceptone(int fd) { CIp their_addr; // connector's address information 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) { perror("Accept accept"); diff --git a/reflector/TCSocket.h b/reflector/TCSocket.h index cdbd9d1..fb66ae0 100644 --- a/reflector/TCSocket.h +++ b/reflector/TCSocket.h @@ -62,7 +62,7 @@ public: private: CIp m_Ip; bool any_are_closed(); - bool acceptone(); + bool acceptone(int fd); }; class CTCClient : public CTCSocket