mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-10-31 09:20:21 +00:00
27 lines
448 B
C++
27 lines
448 B
C++
#include <ev/vpnio.hpp>
|
|
#include <llarp.hpp>
|
|
#include <router/abstractrouter.hpp>
|
|
#include <util/thread/logic.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;
|
|
}
|