socket.h File Reference

#include "common.h"
#include "config.h"
#include "hashlist.h"
#include "vector.h"
#include "thread.h"

Go to the source code of this file.

Data Structures

struct  _cp_socket
struct  _cp_connection_descriptor

Defines

#define CPSOCKET_DEFAULT_BACKLOG   50
#define CPSOCKET_DEFAULT_DELAY_SEC   1
#define CPSOCKET_DEFAULT_DELAY_USEC   0
#define CPSOCKET_THREADPOOL_DEFAULT_SIZE_MIN   5
#define CPSOCKET_THREADPOOL_DEFAULT_SIZE_MAX   50
#define cp_connection_descriptor_get_socket(cd)   ((cd)->sock)
#define cp_connection_descriptor_get_addr(cd)   ((cd)->addr)
#define cp_connection_descriptor_get_fd(cd)   ((cd)->fd)

Typedefs

typedef CPROPS_DLL enum { ... }  cp_socket_strategy
typedef void *(*) cp_socket_thread_function (void *)
typedef int(*) cp_socket_callback (struct _cp_socket *, int fd)
typedef CPROPS_DLL struct
_cp_socket 
cp_socket
typedef CPROPS_DLL struct
_cp_connection_descriptor 
cp_connection_descriptor

Enumerations

enum  { CPSOCKET_STRATEGY_CALLBACK, CPSOCKET_STRATEGY_THREADPOOL }

Functions

void cp_socket_init ()
void cp_socket_stop_all ()
void cp_socket_shutdown ()
CPROPS_DLL void cp_tcp_add_shutdown_callback (void(*cb)(void *), void *prm)
void cp_socket_set_backlog (cp_socket *socket, int backlog)
void cp_socket_set_delay (cp_socket *socket, struct timeval delay)
void cp_socket_set_delay_sec (cp_socket *socket, long sec)
void cp_socket_set_delay_usec (cp_socket *socket, long usec)
void cp_socket_set_poolsize_min (cp_socket *socket, int min)
void cp_socket_set_poolsize_max (cp_socket *socket, int max)
void cp_socket_set_owner (cp_socket *socket, void *owner)
cp_socketcp_socket_create (int port, cp_socket_strategy strategy, void *fn)
void cp_socket_delete (cp_socket *sock)
int cp_socket_listen (cp_socket *sock)
int cp_socket_select (cp_socket *sock)
int cp_socket_connection_close (cp_socket *sock, int fd)
void * cp_socket_add_shutdown_callback (cp_socket *sock, void(*cb)(void *), void *prm)
cp_connection_descriptorcp_connection_descriptor_create (cp_socket *sock, struct sockaddr_in *addr, int fd)
void cp_connection_descriptor_destroy (cp_connection_descriptor *conn_desc)
int cp_connection_descrpitor_read (cp_connection_descriptor *desc, char *buf, int len)
int cp_connection_descriptor_write (cp_connection_descriptor *desc, char *buf, int len)


Detailed Description

definitions for socket abstraction api

Definition in file socket.h.


Generated on Mon Dec 5 23:00:22 2011 for cprops by  doxygen 1.4.7