2 * socket.h -- declarations for socket library functions
4 * For license terms, see the file COPYING in this directory.
10 /* Create a new client socket; returns (FILE *)NULL on error */
12 int SockOpen(const char *host, const char *service, const char *options);
14 int SockOpen(const char *host, int clientPort);
18 Get a string terminated by an '\n' (matches interface of fgets).
19 Pass it a valid socket, a buffer for the string, and
20 the length of the buffer (including the trailing \0)
21 returns buffer on success, NULL on failure.
23 int SockRead(int sock, char *buf, int len);
26 * Peek at the next socket character without actually reading it.
28 int SockPeek(int sock);
31 Write a chunk of bytes to the socket (matches interface of fwrite).
32 Returns number of bytes successfully written.
34 int SockWrite(int sock, char *buf, int size);
37 Send formatted output to the socket (matches interface of fprintf).
38 Returns number of bytes successfully written.
40 #if defined(HAVE_STDARG_H)
41 int SockPrintf(int sock, char *format, ...) ;