Page 1 of 1

Socket monitoring, event loop and non blocking io

Posted: September 8th, 2020, 10:40 am
by skidoo
I dont get it. How to monitor a nonblockig socket in a correct MPD style? Idea is to implemenent a mixer plugin for Sonos. Plugin should discover and control Sonos devices: set MPD http server as Sones input, volume and mute control. My question is how to manage nonblocking tcp socket io with MPD. Any help or source fragments are welche.

Re: Socket monitoring, event loop and non blocking io

Posted: September 8th, 2020, 12:45 pm
by max
Derive from `class SocketMonitor`: https://github.com/MusicPlayerDaemon/MP ... onitor.hxx
... and implement the virtual method `OnSocketReady()`.
Call `Schedule*()` to start polling for events, and `Cancel()` to stop polling.