#include <socket.h>
Data Fields | |
| int | id |
| int | port |
| int | backlog |
| timeval | delay |
| int | connections_served |
| timeval | created |
| cp_hashlist * | fds |
| cp_thread_pool * | tpool |
| int | poolsize_min |
| int | poolsize_max |
| unsigned int | fdn |
| cp_socket_strategy | strategy |
| union { | |
| cp_socket_thread_function thread_fn | |
| cp_socket_callback callback | |
| } | action |
| int | closing |
| void * | owner |
| cp_vector * | shutdown_callback |
If you create a socket with the CPSOCKET_STRATEGY_THREADPOOL, supply a thread function to handle communication once a connection has been accept()-ed. Your cp_thread function should close the connection when done and check the 'closing' flag, which is set to 1 on shutdown.
If you create a socket with the CPSOCKET_STRATEGY_CALLBACK, supply a callback to process incremental feeds as they come along.
Definition at line 119 of file socket.h.
|
|
placeholder for action Referenced by cp_socket_create(). |
|
|
max backlog Definition at line 123 of file socket.h. Referenced by cp_socket_create(), and cp_socket_set_backlog(). |
|
|
shutdown flag |
|
|
number of connections accepted |
|
|
creation time |
|
|
max blocking time Definition at line 124 of file socket.h. Referenced by cp_socket_create(), cp_socket_set_delay(), cp_socket_set_delay_sec(), and cp_socket_set_delay_usec(). |
|
|
largest fd - needed for select() |
|
|
all available file descriptors Definition at line 134 of file socket.h. Referenced by cp_socket_create(). |
|
|
socket id Definition at line 121 of file socket.h. Referenced by cp_socket_create(). |
|
|
max cp_thread count for cp_thread pool Definition at line 137 of file socket.h. Referenced by cp_socket_create(), and cp_socket_set_poolsize_max(). |
|
|
min cp_thread count for cp_thread pool Definition at line 136 of file socket.h. Referenced by cp_socket_create(), and cp_socket_set_poolsize_min(). |
|
|
the port this socket listens on Definition at line 122 of file socket.h. Referenced by cp_socket_create(). |
|
|
shutdown callback list |
|
|
threadpool or callback Definition at line 139 of file socket.h. Referenced by cp_socket_create(). |
|
|
cp_thread pool (if requested) |
1.3.9.1