4 * Header file for TCP client socket library
6 * Copyright (c) 1987-2009 by the citadel.org team
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 int sock_connect(char *host, char *service, char *protocol);
24 int sock_read_to(int *sock, char *buf, int bytes, int timeout, int keep_reading_until_full);
25 int sock_read(int *sock, char *buf, int bytes, int keep_reading_until_full);
26 int sock_write(int *sock, const char *buf, int nbytes);
27 int sock_write_timeout(int *sock, const char *buf, int nbytes, int timeout);
28 int ml_sock_gets(int *sock, char *buf, int nSec);
29 int sock_getln(int *sock, char *buf, int bufsize);
30 int CtdlSockGetLine(int *sock, StrBuf *Target, int nSec);
31 int sock_puts(int *sock, char *buf);
35 * This looks dumb, but it's being done for future portability
37 #define sock_close(sock) close(sock)
38 #define sock_shutdown(sock, how) shutdown(sock, how)
41 * Default timeout for client sessions
43 #define CLIENT_TIMEOUT 600