2 * UCW Library -- Fast Buffered I/O on Sockets with Timeouts
4 * (c) 2008 Martin Mares <mj@ucw.cz>
6 * This software may be freely distributed and used according to the terms
7 * of the GNU Lesser General Public License.
10 #ifndef _UCW_FB_SOCKET_H
11 #define _UCW_FB_SOCKET_H
13 #include "ucw/fastbuf.h"
15 struct fbsock_params { /** Configuration of socket fastbuf. **/
19 void (*err)(void *data, uns flags, char *msg);
20 void *data; // Passed to the err callback
23 enum fbsock_err_flags { /** Description of a socket error **/
24 FBSOCK_READ = 1, // Happened during read
25 FBSOCK_WRITE = 2, // Happened during write
26 FBSOCK_TIMEOUT = 4, // The error is a timeout
30 * Create a new socket fastbuf.
31 * All information is passed by @par.
33 struct fastbuf *fbsock_create(struct fbsock_params *par);