Teonet library
0.4.7
|
Macros | |
#define | TTCP_VERSION "0.0.1" |
#define | SERVER_PORT 9050 |
#define | BUF_LEN 1024 |
Functions | |
void | tcp_server_receive_cb (struct ev_loop *loop, ev_io *w, int revents) |
TCP server receive data from client callback. More... | |
void | tcp_server_accept_cb (struct ev_loop *loop, ev_ksnet_io *w, int revents, int fd) |
TCP server accept callback. More... | |
void | event_cb (ksnetEvMgrClass *ke, ksnetEvMgrEvents event, void *data, size_t data_len, void *user_data) |
Teonet Events callback. More... | |
int | main (int argc, char **argv) |
Main Teotcp application function. More... | |
#define BUF_LEN 1024 |
Referenced by tcp_server_receive_cb(), and test_01().
#define SERVER_PORT 9050 |
Referenced by event_cb().
void event_cb | ( | ksnetEvMgrClass * | ke, |
ksnetEvMgrEvents | event, | ||
void * | data, | ||
size_t | data_len, | ||
void * | user_data | ||
) |
Teonet Events callback.
ke | |
event | |
data | |
data_len | |
user_data |
References teonet_cfg::app_argv, EV_K_STARTED, free(), ksnet_formatMessage(), ksnetEvMgrStop(), ksnTcpServerCreate(), ksnetEvMgrClass::kt, SERVER_PORT, tcp_server_accept_cb(), and ksnetEvMgrClass::teo_cfg.
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
Main Teotcp application function.
argc | Number of parameters |
argv | Parameters array |
References ksnetEvMgrAppParam::app_argc, ksnetEvMgrAppParam::app_argv, ksnetEvMgrAppParam::app_descr, APP_PARAM, event_cb(), ke, ksnetEvMgrInitPort(), ksnetEvMgrRun(), READ_CONFIGURATION, READ_OPTIONS, TTCP_VERSION, and VERSION.
void tcp_server_accept_cb | ( | struct ev_loop * | loop, |
ev_ksnet_io * | w, | ||
int | revents, | ||
int | fd | ||
) |
TCP server accept callback.
loop | |
w | |
revents | |
fd |
References ev_ksnet_io::io, ksnTcpCb(), and tcp_server_receive_cb().
Referenced by event_cb().
void tcp_server_receive_cb | ( | struct ev_loop * | loop, |
ev_io * | w, | ||
int | revents | ||
) |
TCP server receive data from client callback.
loop | |
w | |
revents |
References BUF_LEN, fd, free(), ksnTcpCbStop(), ksnTcpGetServer(), ksnTcpServerStopAll(), and ksnTcpServerStopAllClients().
Referenced by tcp_server_accept_cb().