9 #include <sys/socket.h>
11 int cw_connect(int sockfd
, const struct sockaddr
*serv_addr
, int addrlen
, int ssl
);
13 #define CW_CONNECT_STARTED 0x1
14 #define CW_CONNECT_SSL 0x2
15 #define CW_CONNECT_WANT_READ 0x4
16 #define CW_CONNECT_WANT_WRITE 0x8
17 #define CW_CONNECT_WANT_SOMETHING 0xC
18 #define CW_CONNECT_BLOCKING 0x10
20 /* non-blocking socket
21 state should be initialized with 0, subsequent calls should keep the modified state (state is a bitwise OR between CW_CONNECT_XXX)
22 returns 0 for OK, or if it wants subsequent calls
25 int cw_nb_connect(int sockfd
, const struct sockaddr
*serv_addr
, int addrlen
, int ssl
, int *state
);
26 int cw_accept(int s
, struct sockaddr
*addr
, int *addrlen
, int ssl
);
28 int cw_write(int fd
, const void *buf
, int count
, int ssl
);
29 int cw_read(int fd
, void *buf
, int count
, int ssl
);
33 void cw_setproxy(const char *aproxyhost
, int aproxyport
, const char *aproxyuser
, const char *aproxypass
);
34 void cw_setbind(const char *abindaddr
);
36 char *cw_base64_encode(const char *in
);