diff --git a/docs/changes.rst b/docs/changes.rst index 1d85821c..1a447179 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -58,6 +58,9 @@ v0.6.0 (in development) - Send Spotify search queries to pyspotify as unicode objects, as required by pyspotify 1.4. (Fixes: :issue:`129`) +- Add setting :attr:`mopidy.settings.MPD_SERVER_MAX_CONNECTIONS`. (Fixes: + :issue:`134`) + **multi-backend changes** - Remove `destroy()` methods from backend controller and provider APIs, as it diff --git a/mopidy/frontends/mpd/__init__.py b/mopidy/frontends/mpd/__init__.py index a2faedc2..b6adc09d 100644 --- a/mopidy/frontends/mpd/__init__.py +++ b/mopidy/frontends/mpd/__init__.py @@ -29,7 +29,8 @@ class MpdFrontend(actor.ThreadingActor, listeners.BackendListener): port = settings.MPD_SERVER_PORT try: - network.Server(hostname, port, protocol=MpdSession) + network.Server(hostname, port, protocol=MpdSession, + max_connections=settings.MPD_SERVER_MAX_CONNECTIONS) except IOError, e: logger.error(u'MPD server startup failed: %s', e) sys.exit(1) diff --git a/mopidy/settings.py b/mopidy/settings.py index b1e0c791..ccbf8457 100644 --- a/mopidy/settings.py +++ b/mopidy/settings.py @@ -180,6 +180,11 @@ MPD_SERVER_PORT = 6600 #: Default: :class:`None`, which means no password required. MPD_SERVER_PASSWORD = None +#: The maximum number of concurrent connections the MPD server will accept. +#: +#: Default: 20 +MPD_SERVER_MAX_CONNECTIONS = 20 + #: List of outputs to use. See :mod:`mopidy.outputs` for all available #: backends #: