- /* check timeouts */
- if(F->timeout_handler &&
- F->timeout > 0 && F->timeout < CurrentTime)
- {
- /* Call timeout handler */
- hdl = F->timeout_handler;
- data = F->timeout_data;
- comm_settimeout(F->fd, 0, NULL, NULL);
- hdl(F->fd, data);
+ if(F == NULL)
+ continue;
+ if(!F->flags.open)
+ continue;
+ if(F->flags.closing)
+ continue;
+
+ /* check flush functions */
+ if(F->flush_handler &&
+ F->flush_timeout > 0 && F->flush_timeout < CurrentTime)
+ {
+ hdl = F->flush_handler;
+ data = F->flush_data;
+ comm_setflush(F->fd, 0, NULL, NULL);
+ hdl(F->fd, data);
+ }
+
+ /* check timeouts */
+ if(F->timeout_handler &&
+ F->timeout > 0 && F->timeout < CurrentTime)
+ {
+ /* Call timeout handler */
+ hdl = F->timeout_handler;
+ data = F->timeout_data;
+ comm_settimeout(F->fd, 0, NULL, NULL);
+ hdl(F->fd, data);
+ }