aboutsummaryrefslogtreecommitdiffstats
path: root/src/ClientNew.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-16 21:39:40 +0100
committerMax Kellermann <max@duempel.org>2013-01-16 21:51:08 +0100
commitb0bbb8b693d846c2710ec84bfa79dcaa3a21729a (patch)
tree43cba39160446e9379c188ebb23eae5633de4ea7 /src/ClientNew.cxx
parentcab84af72e373acca0e88d9b407aa97796c083e0 (diff)
downloadmpd-b0bbb8b693d846c2710ec84bfa79dcaa3a21729a.tar.gz
mpd-b0bbb8b693d846c2710ec84bfa79dcaa3a21729a.tar.xz
mpd-b0bbb8b693d846c2710ec84bfa79dcaa3a21729a.zip
Client: use TimeoutMonitor to track connection timeout
Don't use a global loop over the whole client list.
Diffstat (limited to 'src/ClientNew.cxx')
-rw-r--r--src/ClientNew.cxx8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/ClientNew.cxx b/src/ClientNew.cxx
index 42cc3470d..2a4774c55 100644
--- a/src/ClientNew.cxx
+++ b/src/ClientNew.cxx
@@ -49,20 +49,16 @@ static const char GREETING[] = "OK MPD " PROTOCOL_VERSION "\n";
Client::Client(EventLoop &_loop, Partition &_partition,
int _fd, int _uid, int _num)
:BufferedSocket(_fd, _loop, 16384, client_max_output_buffer_size),
+ TimeoutMonitor(_loop),
partition(_partition),
playlist(partition.playlist), player_control(&partition.pc),
permission(getDefaultPermissions()),
uid(_uid),
- last_activity(g_timer_new()),
num(_num),
idle_waiting(false), idle_flags(0),
num_subscriptions(0)
{
-}
-
-Client::~Client()
-{
- g_timer_destroy(last_activity);
+ TimeoutMonitor::ScheduleSeconds(client_timeout);
}
void