Socket monitoring, event loop and non blocking io

Discuss client development (or even MPD development if you feel so inclined), ask questions about the client libs, MPD feature requests from client developers, etc...
Post Reply
skidoo
Posts: 208
Joined: April 28th, 2013, 10:06 pm
Location: Western Germany

Socket monitoring, event loop and non blocking io

Post 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.
max
Forum team
Posts: 1139
Joined: January 15th, 2013, 3:43 pm

Re: Socket monitoring, event loop and non blocking io

Post 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.
Post Reply