1 // Header file for TCP client socket library
3 // Copyright (c) 1987-2012 by the citadel.org team
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.
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.
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);
24 * This looks dumb, but it's being done for future portability
26 #define sock_close(sock) close(sock)
27 #define sock_shutdown(sock, how) shutdown(sock, how)
30 * Default timeout for client sessions
32 #define CLIENT_TIMEOUT 600