7#ifndef KRONKNET_CONNECTION_IMPL_H
8 #define KRONKNET_CONNECTION_IMPL_H
9 #include "kronknet/callback/callback.h"
10 #include "kronknet/macros/types.h"
11 #include "kronknet/utils/rbuff/rbuff.h"
14 #include "../platform/poller.h"
17typedef int (*knConnection_sendHook)(knConnection *,
const void *, size_t);
35 char ip[INET6_ADDRSTRLEN];
47knConnection *knConnection_accept(
const knServer *server);
48void knConnection_destroy(knConnection *conn);
50knConnection *knConnection_create(
const knAddr* addr, knFlags flags);
52int knConnection_setEvents(knConnection *conn, uint32_t events);
Definition connection.h:27
knAddr addr
The actual addr.
Definition connection.h:33
knSocket fd
The fd of the client (or the server in UDP mode).
Definition connection.h:30
knConnection * udp_next
UDP: the next connection whose address has the same key (see knServer_udpFind).
Definition connection.h:41
knPoller * poller
The poller of the server pool.
Definition connection.h:40
knFlags flags
The flags.
Definition connection.h:31
knConnection_sendHook sendHook
The send hook.
Definition connection.h:39
knRBuff * out_buff
The out buffer.
Definition connection.h:38
char ip[INET6_ADDRSTRLEN]
The well-formated ip adrr.
Definition connection.h:35
void * user_ptr
The user datas (eg User struct ...).
Definition connection.h:37
knBool disconnected
Is disconnected ?
Definition connection.h:29
knPort port
The port using by the connection.
Definition connection.h:34
uint64_t last_data
The last time (ms).
Definition connection.h:36
size_t id
The id of the connection ( !same as fd ).
Definition connection.h:32