Back to index

citadel  8.12
clientsocket.h
Go to the documentation of this file.
00001 /*
00002  * Header file for TCP client socket library
00003  *
00004  * Copyright (c) 1987-2012 by the citadel.org team
00005  *
00006  *  This program is open source software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License version 3.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  */
00014 
00015 int sock_connect(char *host, char *service);
00016 int sock_write(int *sock, const char *buf, int nbytes);
00017 int sock_write_timeout(int *sock, const char *buf, int nbytes, int timeout);
00018 int ml_sock_gets(int *sock, char *buf, int nSec);
00019 int sock_getln(int *sock, char *buf, int bufsize);
00020 int CtdlSockGetLine(int *sock, StrBuf *Target, int nSec);
00021 int sock_puts(int *sock, char *buf);
00022 int socket_read_blob(int *Socket, StrBuf * Target, int bytes, int timeout);
00023 
00024 
00025 /* 
00026  * This looks dumb, but it's being done for future portability
00027  */
00028 #define sock_close(sock)           close(sock)
00029 #define sock_shutdown(sock, how)   shutdown(sock, how)
00030 
00031 /* 
00032  * Default timeout for client sessions
00033  */
00034 #define CLIENT_TIMEOUT             600