Search found 2 matches

by jlk
January 14th, 2015, 2:30 pm
Forum: Developers' Corner
Topic: [libmpdclient] detect lost connection to MPD daemon
Replies: 2
Views: 2389

Re: [libmpdclient] detect lost connection to MPD daemon

The simplified code I'm working with is the following: #include <stdio.h> #include <unistd.h> #include <mpd/client.h> int main(void) { struct mpd_connection* m_connection = NULL; struct mpd_status* m_status = NULL; char* m_state_str; m_connection = mpd_connection_new(NULL, 0, 30000); while (1) { // ...
by jlk
January 13th, 2015, 9:28 pm
Forum: Developers' Corner
Topic: [libmpdclient] detect lost connection to MPD daemon
Replies: 2
Views: 2389

[libmpdclient] detect lost connection to MPD daemon

I'm writing a plugin for my statusbar to print MPD state, currently using the libmpdclient library. It has to be robust to properly handle lost connections in case MPD is restarted, but simple checking with mpd_connection_get_error on existing mpd_connection object does not work – it can detect the ...