mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-03-09 15:40:12 +00:00
network: add timeout for client connections
Somtimes client connetions will not close therfore add a timeout. Add a new timer that checks every 5s if we did not receive anything from a client for (default) 60s. Can be configured via client_timeout. Code is based on the work of ptpt52. Signed-off-by: Nick Hainke <vincent@systemli.org>
This commit is contained in:
parent
e596ff1317
commit
eba03547a5
8 changed files with 50 additions and 0 deletions
|
|
@ -109,6 +109,7 @@ struct time_config_s {
|
|||
time_t update_tcp_con; // Refresh network connections
|
||||
time_t update_chan_util; // Refresh per radio / SSID channel util info
|
||||
time_t update_beacon_reports; // Request BEACON from capable clients
|
||||
time_t client_timeout; // Check for client timeouts.
|
||||
};
|
||||
|
||||
struct local_config_s {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
#include <netinet/in.h>
|
||||
|
||||
#define ARRAY_NETWORK_LEN 50
|
||||
#define CHECK_CLIENT_TIMEOUT 5
|
||||
|
||||
struct network_con_s {
|
||||
struct list_head list;
|
||||
|
|
@ -36,6 +37,11 @@ int run_server(int port);
|
|||
*/
|
||||
void send_tcp(char *msg);
|
||||
|
||||
/**
|
||||
* Check sockets for client timeouts.
|
||||
*/
|
||||
void check_client_timeout(int timeout);
|
||||
|
||||
/**
|
||||
* Debug message.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue