This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
stellar-stellar/src/session/session_timer.h

31 lines
931 B
C
Raw Normal View History

2023-12-12 18:41:53 +08:00
#ifndef _SESSION_TIMER_H
#define _SESSION_TIMER_H
2024-04-21 11:30:41 +08:00
#ifdef __cplusplus
2023-12-12 18:41:53 +08:00
extern "C"
{
#endif
#include "session_priv.h"
2023-12-12 18:41:53 +08:00
struct session_timer;
2024-03-29 19:44:20 +08:00
struct session_timer *session_timer_new(uint64_t now);
void session_timer_free(struct session_timer *timer);
2024-03-29 19:44:20 +08:00
void session_timer_update(struct session_timer *timer, struct session *sess, uint64_t expires);
void session_timer_add(struct session_timer *timer, struct session *sess, uint64_t expires);
void session_timer_del(struct session_timer *timer, struct session *sess);
2023-12-12 18:41:53 +08:00
/*
* return one session which timeout, or NULL if no session timeout.
* if return session, the session will be removed from timer.
*/
struct session *session_timer_expire(struct session_timer *timer, uint64_t abs_current_ts);
// return 0: have already timeout session
// return >0: next expire interval
uint64_t session_timer_next_expire_interval(struct session_timer *timer);
2023-12-12 18:41:53 +08:00
2024-04-21 11:30:41 +08:00
#ifdef __cplusplus
2023-12-12 18:41:53 +08:00
}
#endif
#endif