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 146 of file sync.c.

References mpd_async_events(), and mpd_async_io().

      struct timeval tv, *tvp;

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

      if (!mpd_async_io(async, MPD_ASYNC_EVENT_WRITE))
            return false;

      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_sync_io(async, tvp))
                  return false;

Generated by  Doxygen 1.6.0   Back to index