You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lokinet/llarp/ev/vpnio.cpp

26 lines
415 B
C++

#include <ev/vpnio.hpp>
#include <llarp.hpp>
#include <router/abstractrouter.hpp>
void
llarp_vpn_io_impl::AsyncClose()
{
reader.queue.disable();
writer.queue.disable();
// TODO: call asynchronously
if (ctx)
ctx->CallSafe([this]() { Expunge(); });
else
Expunge();
}
void
llarp_vpn_io_impl::Expunge()
{
parent->impl = nullptr;
if (parent->closed)
parent->closed(parent);
delete this;
}