struct IODescriptor {
int fd;
- FILE *file;
enum IOType type;
enum IOStatus state;
struct timeval timeout;
} data;
};
-struct IODescriptor *iohandler_add(int sockfd, enum IOType type, iohandler_callback *callback);
-struct IODescriptor *iohandler_file(FILE *file, iohandler_callback *callback);
+struct IODescriptor *iohandler_add(int sockfd, enum IOType type, struct timeval *timeout, iohandler_callback *callback);
struct IODescriptor *iohandler_timer(struct timeval timeout, iohandler_callback *callback);
struct IODescriptor *iohandler_connect(const char *hostname, unsigned int port, int ssl, const char *bind, iohandler_callback *callback);
struct IODescriptor *iohandler_listen(const char *hostname, unsigned int port, int ssl, iohandler_callback *callback);
void iohandler_printf(struct IODescriptor *iofd, const char *text, ...);
void iohandler_close(struct IODescriptor *iofd);
void iohandler_update(struct IODescriptor *iofd);
+void iohandler_set_timeout(struct IODescriptor *iofd, struct timeval *timeout);
void iohandler_poll();