misc cleanup
[citadel.git] / citadel / clientsocket.h
1 // Header file for TCP client socket library
2 //
3 // Copyright (c) 1987-2012 by the citadel.org team
4 //
5 //  This program is open source software; you can redistribute it and/or modify
6 //  it under the terms of the GNU General Public License version 3.
7 //
8 //  This program is distributed in the hope that it will be useful,
9 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 //  GNU General Public License for more details.
12
13 int sock_connect(char *host, char *service);
14 int sock_write(int *sock, const char *buf, int nbytes);
15 int sock_write_timeout(int *sock, const char *buf, int nbytes, int timeout);
16 int ml_sock_gets(int *sock, char *buf, int nSec);
17 int sock_getln(int *sock, char *buf, int bufsize);
18 int CtdlSockGetLine(int *sock, StrBuf *Target, int nSec);
19 int sock_puts(int *sock, char *buf);
20 int socket_read_blob(int *Socket, StrBuf * Target, int bytes, int timeout);
21
22
23 /* 
24  * This looks dumb, but it's being done for future portability
25  */
26 #define sock_close(sock)                close(sock)
27 #define sock_shutdown(sock, how)        shutdown(sock, how)
28
29 /* 
30  * Default timeout for client sessions
31  */
32 #define CLIENT_TIMEOUT          600