|
OSSIA
Open Scenario System for Interactive Application
|
Liveness token for a socket's asio completion handlers.
Closing a descriptor does not make asio forget the operations pending on it: they complete with operation_aborted on a later poll(), often after the owner is gone. Handlers capture this, so they take a weak reference to this token and give up once it has expired.
Held by value in the tracked object, hence non-copyable.
Public Member Functions | |
| lifetime_token (const lifetime_token &)=delete | |
| lifetime_token (lifetime_token &&)=delete | |
| lifetime_token & | operator= (const lifetime_token &)=delete |
| lifetime_token & | operator= (lifetime_token &&)=delete |
| std::weak_ptr< void > | watch () const noexcept |
| void | reset () noexcept |
|
inlinenoexcept |
Expire every watch. Members die after the destructor body, so a socket closing itself there still looks alive unless this is called first.