9cc4c12a12dca3a1248cb4b78b1d50db7bb60ca7
[citadel.git] / citadel / clientsocket.h
1 /*
2  * $Id$
3  *
4  * Header file for TCP client socket library
5  */
6
7 int sock_connect(char *host, char *service, char *protocol);
8 int sock_read_to(int sock, char *buf, int bytes, int timeout, int keep_reading_until_full);
9 int sock_read(int sock, char *buf, int bytes, int keep_reading_until_full);
10 int sock_write(int sock, char *buf, int nbytes);
11 int ml_sock_gets(int sock, char *buf);
12 int sock_getln(int sock, char *buf, int bufsize);
13 int sock_puts(int sock, char *buf);
14
15
16 /* 
17  * This looks dumb, but it's being done for future portability
18  */
19 #define sock_close(sock)                close(sock)
20 #define sock_shutdown(sock, how)        shutdown(sock, how)
21
22 /* 
23  * Default timeout for client sessions
24  */
25 #define CLIENT_TIMEOUT          600