#include "ipsnooper.h"
Functions | |
void | session_thread_exit (ssn_thrd_t *thrd) |
void | server_close (void) |
int | server_init (evContext ctx) |
Variables | |
ssn_thrd_t | ssn_thrd [MSP_MAX_CPUS] |
These functions manage client connection and communication. The main server process is scheduled to run any available control CPU. After a client connection setup, server process will find out which control CPU was assigned to handle the flow for this client.
If there is already a session thread running on that control CPU, the server process will send the new session info to that thread by the pipe.
Otherwise, the server process creates a session thread and binds it to that control CPU. A pipe between the server process and the session thread will be created too.
The session thread has its own event context and listens to the pipe and all session sockets. Once it receives a request from a client, it will process and reply it.
When the session is closed by client, the session thread will remove it from its listen list and notify server process to clean it up. The session thread will stay once it was created, even all sessions are closed.
void server_close | ( | void | ) |
Close the server only.
int server_init | ( | evContext | ctx | ) |
Initialize the server
[in] | ctx | Event context |
void session_thread_exit | ( | ssn_thrd_t * | thrd | ) |
Session thread exit.
[in] | thrd | Pointer to the session thread data |
ssn_thrd_t ssn_thrd[MSP_MAX_CPUS] |
session thread data structures