TCPServer Receive bug fix

pull/3/head
Tom Early 2 years ago
parent ee1bd2228b
commit d58f5a2486

@ -57,7 +57,6 @@ void CTCSocket::Close(int fd)
{ {
if (fd < 0) if (fd < 0)
{ {
std::cerr << "Close(fd) : fd is -1" << std::endl;
return; return;
} }
for (auto &p : m_Pfd) for (auto &p : m_Pfd)
@ -207,6 +206,8 @@ bool CTCServer::Receive(char module, STCPacket *packet, int ms)
std::cerr << "POLLNVAL received on module " << module << "'" << std::endl; std::cerr << "POLLNVAL received on module " << module << "'" << std::endl;
} }
if (rv)
Close(pfds->fd);
return ! rv; return ! rv;
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.