struct IODescriptor {
int fd;
+ FILE *file;
enum IOType type;
enum IOStatus state;
struct timeval timeout;
};
struct IODescriptor *iohandler_add(int sockfd, enum IOType type, iohandler_callback *callback);
+struct IODescriptor *iohandler_file(FILE *file, iohandler_callback *callback);
struct IODescriptor *iohandler_timer(struct timeval timeout, iohandler_callback *callback);
struct IODescriptor *iohandler_connect(const char *hostname, unsigned int port, const char *bind, iohandler_callback *callback);
struct IODescriptor *iohandler_listen(const char *hostname, unsigned int port, iohandler_callback *callback);