23 #ifndef __LSCP_SOCKET_H
24 #define __LSCP_SOCKET_H
32 #include <sys/socket.h>
33 #include <netinet/in.h>
34 #include <netinet/tcp.h>
35 #include <arpa/inet.h>
39 #if defined(__cplusplus)
48 typedef int socklen_t;
51 #define INVALID_SOCKET -1
52 #define SOCKET_ERROR -1
53 #define closesocket(s) close(s)
56 #define LSCP_BUFSIZ 1024
62 void lscp_socket_trace (
const char *pszPrefix,
struct sockaddr_in *pAddr,
const char *pchBuffer,
int cchBuffer);
71 struct sockaddr_in
addr;
82 #if defined(__cplusplus)
void lscp_socket_getopts(const char *pszPrefix, lscp_socket_t sock)
Definition: socket.c:153
struct _lscp_socket_agent_t lscp_socket_agent_t
void lscp_socket_agent_init(lscp_socket_agent_t *pAgent, lscp_socket_t sock, struct sockaddr_in *pAddr, int cAddr)
Definition: socket.c:198
int lscp_socket_t
Definition: socket.h:50
lscp_status_t lscp_socket_agent_start(lscp_socket_agent_t *pAgent, lscp_thread_proc_t pfnProc, void *pvData, int iDetach)
Definition: socket.c:211
void lscp_socket_herror(const char *pszPrefix)
Definition: socket.c:119
lscp_status_t lscp_socket_agent_free(lscp_socket_agent_t *pAgent)
Definition: socket.c:236
void lscp_socket_trace(const char *pszPrefix, struct sockaddr_in *pAddr, const char *pchBuffer, int cchBuffer)
Definition: socket.c:170
lscp_status_t lscp_socket_agent_join(lscp_socket_agent_t *pAgent)
Definition: socket.c:225
void lscp_socket_perror(const char *pszPrefix)
Definition: socket.c:114
lscp_socket_t sock
Definition: socket.h:70
lscp_thread_t * pThread
Definition: socket.h:72
struct sockaddr_in addr
Definition: socket.h:71
int iState
Definition: socket.h:73
void(* lscp_thread_proc_t)(void *pvData)
Definition: thread.h:101
enum _lscp_status_t lscp_status_t