diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2014-12-19 19:18:54 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-01-18 18:11:08 +0100 |
commit | 03b463034885e7ebb09160f6d63c05ac120a8098 (patch) | |
tree | f04b6e49fc98b07c9f62993ce3a5f5c5ad202c99 /openbsc/include/openbsc/gprs_gsup_client.h | |
parent | e154d8bdd45974fa6e9408b9d543eb9e9ea94b79 (diff) |
gprs: Send PING and eventually reconnect
Currently, the reconnect mechanism relies on gsup_client_updown_cb
which in turn gets called based on the OS' view of connection state.
This patch adds a timer based PING mechanism that regularly sends
PING messages and forces a reconnect if a PONG message won't be
received until the next PING message is scheduled. The current ping
interval is 20s.
Sponsored-by: On-Waves ehf
Conflicts:
openbsc/src/gprs/gprs_gsup_client.c
[hfreyther: Conflicts due the potential memleak fix by me. Removed
another TODO from the code as we stop the ping/pong timer]
Diffstat (limited to 'openbsc/include/openbsc/gprs_gsup_client.h')
-rw-r--r-- | openbsc/include/openbsc/gprs_gsup_client.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/gprs_gsup_client.h b/openbsc/include/openbsc/gprs_gsup_client.h index 1165c4a78..9537db4c7 100644 --- a/openbsc/include/openbsc/gprs_gsup_client.h +++ b/openbsc/include/openbsc/gprs_gsup_client.h @@ -24,6 +24,7 @@ #include <osmocom/core/timer.h> #define GPRS_GSUP_RECONNECT_INTERVAL 10 +#define GPRS_GSUP_PING_INTERVAL 20 struct msgb; struct ipa_client_conn; @@ -37,8 +38,10 @@ struct gprs_gsup_client { gprs_gsup_read_cb_t read_cb; void *data; + struct osmo_timer_list ping_timer; struct osmo_timer_list connect_timer; int is_connected; + int got_ipa_pong; }; struct gprs_gsup_client *gprs_gsup_client_create(const char *ip_addr, |