event/MultiSocketMonitor: PrepareSockets() returns timeout

Simplify the API, don't use GLib specific integer type.
This commit is contained in:
Max Kellermann
2013-08-10 10:57:00 +02:00
parent cbd0709d1c
commit be0c8495cd
3 changed files with 17 additions and 11 deletions

View File

@@ -101,7 +101,10 @@ public:
}
protected:
virtual void PrepareSockets(gcc_unused gint *timeout_r) {}
/**
* @return timeout [ms] or -1 for no timeout
*/
virtual int PrepareSockets() = 0;
virtual bool CheckSockets() const { return false; }
virtual void DispatchSockets() = 0;
@@ -114,7 +117,7 @@ public:
private:
bool Prepare(gint *timeout_r) {
PrepareSockets(timeout_r);
*timeout_r = PrepareSockets();
return false;
}