Add session timer

This commit is contained in:
luwenpeng
2023-12-12 18:41:53 +08:00
parent 006315fb7c
commit 2d3e182b5a
11 changed files with 612 additions and 234 deletions

View File

@@ -14,6 +14,14 @@ extern "C"
#include "session.h"
#include "session_address.h"
#define TIMEOUT_CB_OVERRIDE
struct timeout_cb
{
session_expire_cb fn;
struct session *arg;
};
#include "timeout.h"
#define EX_DATA_MAX_COUNT 128
#define SESSION_EVENT_QUEUE_SIZE 256
@@ -45,7 +53,6 @@ struct session
// session timestamp
uint64_t create_time;
uint64_t last_time;
uint64_t expire_time;
/******************************
* Session Ev Queue Zone
@@ -64,6 +71,8 @@ struct session
******************************/
// session timer
struct timeout timeout;
uint64_t abs_expire_ts;
/******************************
* Session Pool Zone