Add session timer
This commit is contained in:
26
src/session/session_timer.h
Normal file
26
src/session/session_timer.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef _SESSION_TIMER_H
|
||||
#define _SESSION_TIMER_H
|
||||
|
||||
#ifdef __cpluscplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include "session.h"
|
||||
|
||||
struct session_timer;
|
||||
struct session_timer *session_timer_create();
|
||||
void session_timer_destroy(struct session_timer *timer);
|
||||
void session_timer_add_session(struct session_timer *timer, struct session *sess);
|
||||
void session_timer_del_session(struct session_timer *timer, struct session *sess);
|
||||
/*
|
||||
* 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_session(struct session_timer *timer, uint64_t abs_current_ts);
|
||||
|
||||
#ifdef __cpluscplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user