void TcpServer::removeConnectionInLoop(TcpConnectionPtr& conn){ EventLoop* loop = conn->getEventLoop(); loop->runInLoop(std::bind(&TcpConnection::handleClose, conn)); connectionmap.erase(conn->getFd()); }