]> code.citadel.org Git - citadel.git/blobdiff - citadel/clientsocket.h
misc cleanup
[citadel.git] / citadel / clientsocket.h
index 6bbe88db57eadd2aefe7908bea23004e874d2cf5..cc275e1a53083dd16047b2c2add12ad42e079805 100644 (file)
@@ -1,17 +1,32 @@
-/*
- * $Id$
- *
- * Header file for TCP client socket library
- */
+// Header file for TCP client socket library
+//
+// Copyright (c) 1987-2012 by the citadel.org team
+//
+//  This program is open source software; you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License version 3.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+
+int sock_connect(char *host, char *service);
+int sock_write(int *sock, const char *buf, int nbytes);
+int sock_write_timeout(int *sock, const char *buf, int nbytes, int timeout);
+int ml_sock_gets(int *sock, char *buf, int nSec);
+int sock_getln(int *sock, char *buf, int bufsize);
+int CtdlSockGetLine(int *sock, StrBuf *Target, int nSec);
+int sock_puts(int *sock, char *buf);
+int socket_read_blob(int *Socket, StrBuf * Target, int bytes, int timeout);
 
-int sock_connect(char *host, char *service, char *protocol);
-int sock_read(int sock, char *buf, int bytes);
-int sock_write(int sock, char *buf, int nbytes);
-int ml_sock_gets(int sock, char *buf);
-int sock_gets(int sock, char *buf);
-int sock_puts(int sock, char *buf);
 
 /* 
  * This looks dumb, but it's being done for future portability
  */
-#define sock_close(sock)       close(sock)
+#define sock_close(sock)               close(sock)
+#define sock_shutdown(sock, how)       shutdown(sock, how)
+
+/* 
+ * Default timeout for client sessions
+ */
+#define CLIENT_TIMEOUT         600