client ttl; some refactoring

This commit is contained in:
Devaev Maxim
2021-01-17 08:35:25 +03:00
parent 14131f0b54
commit 4fb8c7745c
5 changed files with 43 additions and 28 deletions

View File

@@ -65,6 +65,7 @@ typedef struct {
const char *obj;
bool server;
bool rm;
unsigned client_ttl; // Only for server
unsigned timeout;
int fd;
@@ -74,7 +75,10 @@ typedef struct {
} memsink_s;
memsink_s *memsink_init(const char *name, const char *obj, bool server, mode_t mode, bool rm, unsigned timeout);
memsink_s *memsink_init(
const char *name, const char *obj, bool server,
mode_t mode, bool rm, unsigned client_ttl, unsigned timeout);
void memsink_destroy(memsink_s *sink);
int memsink_server_check_clients(memsink_s *sink);