add Context::close()
This commit is contained in:
@@ -46,6 +46,9 @@ Connection::~Connection()
|
||||
std::shared_ptr<Connection> Connection::build(const std::shared_ptr<ContextImpl>& context,
|
||||
const SockAddr& serv, bool reconn)
|
||||
{
|
||||
if(context->state!=ContextImpl::Running)
|
||||
throw std::logic_error("Context close()d");
|
||||
|
||||
std::shared_ptr<Connection> ret;
|
||||
auto it = context->connByAddr.find(serv);
|
||||
if(it==context->connByAddr.end() || !(ret = it->second.lock())) {
|
||||
|
||||
Reference in New Issue
Block a user