Logo Search packages:      
Sourcecode: libmpdclient version File versions  Download package

bool mpd_sync_flush ( struct mpd_async async,
const struct timeval *  tv 
)

Sends all pending data from the output buffer to MPD.

Definition at line 155 of file sync.c.

References mpd_async_events(), mpd_async_get_error(), and MPD_ERROR_SUCCESS.

{
      struct timeval tv, *tvp;

      if (tv0 != NULL) {
            tv = *tv0;
            tvp = &tv;
      } else
            tvp = NULL;

      while (true) {
            enum mpd_async_event events = mpd_async_events(async);
            if ((events & MPD_ASYNC_EVENT_WRITE) == 0)
                  /* no more pending writes */
                  return true;

            if (mpd_async_get_error(async) != MPD_ERROR_SUCCESS ||
                !mpd_sync_io(async, tvp))
                  return false;
      }
}


Generated by  Doxygen 1.6.0   Back to index