--- a/mpd2src/mpd2sc.cpp
+++ b/mpd2src/mpd2sc.cpp
@@ -201,6 +201,8 @@
continue; // Ignore failed request
}
if (num_bytes > 0) {
+ string response("OK");
+
if (strncmp("play", buf, num_bytes) == 0)
pcmsender->Play();
else if (strncmp("stop", buf, num_bytes) == 0)
@@ -217,6 +219,13 @@
sender->SetMulticast(true);
else if (strncmp("unicast", buf, num_bytes) == 0)
sender->SetMulticast(false);
+
+ ssize_t bytes_sent = sendto(g_sockfd, (const void *)response.c_str(),
+ response.length(), 0, (struct sockaddr *)&client_addr, len);
+ if (bytes_sent == -1) {
+ LOGERR("Error: Cannot write to socket: " <<
+ strerror(errno) << endl);
+ }
}
} while (!g_quitrequest);