diff --git a/api/net/sf/briar/api/plugins/BatchPluginFactory.java b/api/net/sf/briar/api/plugins/BatchPluginFactory.java
index 3b60ba013941f24e7825d16176de08bbf6db52e4..314497fd4073071a8f38b53e56ece5dd5972cf6e 100644
--- a/api/net/sf/briar/api/plugins/BatchPluginFactory.java
+++ b/api/net/sf/briar/api/plugins/BatchPluginFactory.java
@@ -1,8 +1,9 @@
 package net.sf.briar.api.plugins;
 
-import java.util.concurrent.Executor;
+import java.util.concurrent.ScheduledExecutorService;
 
 public interface BatchPluginFactory {
 
-	BatchPlugin createPlugin(Executor e, BatchPluginCallback callback);
+	BatchPlugin createPlugin(ScheduledExecutorService pluginExecutor,
+			BatchPluginCallback callback);
 }
diff --git a/api/net/sf/briar/api/plugins/StreamPluginFactory.java b/api/net/sf/briar/api/plugins/StreamPluginFactory.java
index 3d48a1d2c80e3439d56f7ca07eb0df16353058ec..6dae0df700204d941aaba868361f517be98ebcfa 100644
--- a/api/net/sf/briar/api/plugins/StreamPluginFactory.java
+++ b/api/net/sf/briar/api/plugins/StreamPluginFactory.java
@@ -1,8 +1,9 @@
 package net.sf.briar.api.plugins;
 
-import java.util.concurrent.Executor;
+import java.util.concurrent.ScheduledExecutorService;
 
 public interface StreamPluginFactory {
 
-	StreamPlugin createPlugin(Executor e, StreamPluginCallback callback);
+	StreamPlugin createPlugin(ScheduledExecutorService pluginExecutor,
+			StreamPluginCallback callback);
 }
diff --git a/components/net/sf/briar/plugins/PluginManagerImpl.java b/components/net/sf/briar/plugins/PluginManagerImpl.java
index 83d5e1ef2ea360e53b7de94ed4946c386e06950c..a88c8b563c7d5d6c47a13cb4f4a8bb8ccdd340fb 100644
--- a/components/net/sf/briar/plugins/PluginManagerImpl.java
+++ b/components/net/sf/briar/plugins/PluginManagerImpl.java
@@ -7,7 +7,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.concurrent.Executor;
+import java.util.concurrent.ScheduledExecutorService;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -51,7 +51,7 @@ class PluginManagerImpl implements PluginManager {
 		"net.sf.briar.plugins.socket.SimpleSocketPluginFactory"
 	};
 
-	private final Executor pluginExecutor;
+	private final ScheduledExecutorService pluginExecutor;
 	private final DatabaseComponent db;
 	private final Poller poller;
 	private final ConnectionDispatcher dispatcher;
@@ -60,7 +60,7 @@ class PluginManagerImpl implements PluginManager {
 	private final List<StreamPlugin> streamPlugins; // Locking: this
 
 	@Inject
-	PluginManagerImpl(@PluginExecutor Executor pluginExecutor,
+	PluginManagerImpl(@PluginExecutor ScheduledExecutorService pluginExecutor,
 			DatabaseComponent db, Poller poller,
 			ConnectionDispatcher dispatcher, UiCallback uiCallback) {
 		this.pluginExecutor = pluginExecutor;
diff --git a/components/net/sf/briar/plugins/PluginsModule.java b/components/net/sf/briar/plugins/PluginsModule.java
index c725cd36ce487c42e108c0d140ef680b15827fb6..1fcf8d3a9d87f291b3c3baaf67ad64ca6d9ae010 100644
--- a/components/net/sf/briar/plugins/PluginsModule.java
+++ b/components/net/sf/briar/plugins/PluginsModule.java
@@ -1,7 +1,7 @@
 package net.sf.briar.plugins;
 
-import java.util.concurrent.Executor;
 import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
 
 import net.sf.briar.api.plugins.PluginExecutor;
 import net.sf.briar.api.plugins.PluginManager;
@@ -13,8 +13,9 @@ public class PluginsModule extends AbstractModule {
 
 	@Override
 	protected void configure() {
-		bind(Executor.class).annotatedWith(PluginExecutor.class).toInstance(
-				Executors.newCachedThreadPool());
+		bind(ScheduledExecutorService.class).annotatedWith(
+				PluginExecutor.class).toInstance(
+						Executors.newScheduledThreadPool(1));
 		bind(PluginManager.class).to(
 				PluginManagerImpl.class).in(Singleton.class);
 		bind(Poller.class).to(PollerImpl.class);
diff --git a/components/net/sf/briar/plugins/bluetooth/BluetoothPlugin.java b/components/net/sf/briar/plugins/bluetooth/BluetoothPlugin.java
index 194cb4d1f4c8cf7580668de79c5f7dc93868722c..7884ead6c5658f3175db0dea1f1bd3d22ee874a7 100644
--- a/components/net/sf/briar/plugins/bluetooth/BluetoothPlugin.java
+++ b/components/net/sf/briar/plugins/bluetooth/BluetoothPlugin.java
@@ -7,7 +7,8 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Random;
-import java.util.concurrent.Executor;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -38,7 +39,7 @@ class BluetoothPlugin implements StreamPlugin {
 	private static final Logger LOG =
 		Logger.getLogger(BluetoothPlugin.class.getName());
 
-	private final Executor pluginExecutor;
+	private final ScheduledExecutorService pluginExecutor;
 	private final StreamPluginCallback callback;
 	private final long pollingInterval;
 	private final Object discoveryLock = new Object();
@@ -47,7 +48,7 @@ class BluetoothPlugin implements StreamPlugin {
 	private LocalDevice localDevice = null; // Locking: this
 	private StreamConnectionNotifier socket = null; // Locking: this
 
-	BluetoothPlugin(@PluginExecutor Executor pluginExecutor,
+	BluetoothPlugin(@PluginExecutor ScheduledExecutorService pluginExecutor,
 			StreamPluginCallback callback, long pollingInterval) {
 		this.pluginExecutor = pluginExecutor;
 		this.callback = callback;
@@ -376,18 +377,11 @@ class BluetoothPlugin implements StreamPlugin {
 			return;
 		}
 		// Close the socket when the invitation times out
-		pluginExecutor.execute(new Runnable() {
+		pluginExecutor.schedule(new Runnable() {
 			public void run() {
-				try {
-					Thread.sleep(c.getTimeout());
-				} catch(InterruptedException e) {
-					if(LOG.isLoggable(Level.INFO))
-						LOG.info("Interrupted while waiting for invitation");
-					Thread.currentThread().interrupt();
-				}
 				tryToClose(scn);
 			}
-		});
+		}, c.getTimeout(), TimeUnit.MILLISECONDS);
 		try {
 			StreamConnection s = scn.acceptAndOpen();
 			c.addConnection(s);
diff --git a/components/net/sf/briar/plugins/bluetooth/BluetoothPluginFactory.java b/components/net/sf/briar/plugins/bluetooth/BluetoothPluginFactory.java
index a7a55fa1c3fefc0db6cfb19c93ad2190e640672e..4c4a3a730e978211d7a41f961cdc4a65d2861633 100644
--- a/components/net/sf/briar/plugins/bluetooth/BluetoothPluginFactory.java
+++ b/components/net/sf/briar/plugins/bluetooth/BluetoothPluginFactory.java
@@ -1,6 +1,6 @@
 package net.sf.briar.plugins.bluetooth;
 
-import java.util.concurrent.Executor;
+import java.util.concurrent.ScheduledExecutorService;
 
 import net.sf.briar.api.plugins.PluginExecutor;
 import net.sf.briar.api.plugins.StreamPlugin;
@@ -11,7 +11,8 @@ public class BluetoothPluginFactory implements StreamPluginFactory {
 
 	private static final long POLLING_INTERVAL = 3L * 60L * 1000L; // 3 mins
 
-	public StreamPlugin createPlugin(@PluginExecutor Executor pluginExecutor,
+	public StreamPlugin createPlugin(
+			@PluginExecutor ScheduledExecutorService pluginExecutor,
 			StreamPluginCallback callback) {
 		return new BluetoothPlugin(pluginExecutor, callback, POLLING_INTERVAL);
 	}
diff --git a/components/net/sf/briar/plugins/file/RemovableDrivePluginFactory.java b/components/net/sf/briar/plugins/file/RemovableDrivePluginFactory.java
index 81f719c8dcf5454d4aaf0e73b772b9ae2233ba84..1a0353a1e2c240232b58785be2483788878ffe46 100644
--- a/components/net/sf/briar/plugins/file/RemovableDrivePluginFactory.java
+++ b/components/net/sf/briar/plugins/file/RemovableDrivePluginFactory.java
@@ -1,6 +1,6 @@
 package net.sf.briar.plugins.file;
 
-import java.util.concurrent.Executor;
+import java.util.concurrent.ScheduledExecutorService;
 
 import net.sf.briar.api.plugins.BatchPlugin;
 import net.sf.briar.api.plugins.BatchPluginCallback;
@@ -12,7 +12,8 @@ public class RemovableDrivePluginFactory implements BatchPluginFactory {
 
 	private static final long POLLING_INTERVAL = 10L * 1000L; // 10 seconds
 
-	public BatchPlugin createPlugin(@PluginExecutor Executor pluginExecutor,
+	public BatchPlugin createPlugin(
+			@PluginExecutor ScheduledExecutorService pluginExecutor,
 			BatchPluginCallback callback) {
 		RemovableDriveFinder finder;
 		RemovableDriveMonitor monitor;
diff --git a/components/net/sf/briar/plugins/socket/LanSocketPlugin.java b/components/net/sf/briar/plugins/socket/LanSocketPlugin.java
index 9e5c3742c1df69b7589435292f75df9d4c183e05..0de1417a9b4913046ec6723fb63a1b3d2ed7f131 100644
--- a/components/net/sf/briar/plugins/socket/LanSocketPlugin.java
+++ b/components/net/sf/briar/plugins/socket/LanSocketPlugin.java
@@ -10,7 +10,7 @@ import java.net.Socket;
 import java.net.SocketTimeoutException;
 import java.net.UnknownHostException;
 import java.util.Random;
-import java.util.concurrent.Executor;
+import java.util.concurrent.ScheduledExecutorService;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -25,7 +25,7 @@ class LanSocketPlugin extends SimpleSocketPlugin {
 	private static final Logger LOG =
 		Logger.getLogger(LanSocketPlugin.class.getName());
 
-	LanSocketPlugin(@PluginExecutor Executor pluginExecutor,
+	LanSocketPlugin(@PluginExecutor ScheduledExecutorService pluginExecutor,
 			StreamPluginCallback callback, long pollingInterval) {
 		super(pluginExecutor, callback, pollingInterval);
 	}
diff --git a/components/net/sf/briar/plugins/socket/SimpleSocketPlugin.java b/components/net/sf/briar/plugins/socket/SimpleSocketPlugin.java
index 1a6bb99eb16f1ea6bb28d6eec084346a5eefa719..332f7e82ab2c4311f81dfa8f7f7b63aa6b746540 100644
--- a/components/net/sf/briar/plugins/socket/SimpleSocketPlugin.java
+++ b/components/net/sf/briar/plugins/socket/SimpleSocketPlugin.java
@@ -9,7 +9,7 @@ import java.net.Socket;
 import java.net.SocketAddress;
 import java.util.Collections;
 import java.util.List;
-import java.util.concurrent.Executor;
+import java.util.concurrent.ScheduledExecutorService;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -31,7 +31,7 @@ class SimpleSocketPlugin extends SocketPlugin {
 	private static final Logger LOG =
 		Logger.getLogger(SimpleSocketPlugin.class.getName());
 
-	SimpleSocketPlugin(@PluginExecutor Executor pluginExecutor,
+	SimpleSocketPlugin(@PluginExecutor ScheduledExecutorService pluginExecutor,
 			StreamPluginCallback callback, long pollingInterval) {
 		super(pluginExecutor, callback, pollingInterval);
 	}
diff --git a/components/net/sf/briar/plugins/socket/SimpleSocketPluginFactory.java b/components/net/sf/briar/plugins/socket/SimpleSocketPluginFactory.java
index a34e21ead8d1c00e6800c70b653155007d4e9e94..6e7fc5e5f4fbee236d092ab55fc55e4c1f9ae733 100644
--- a/components/net/sf/briar/plugins/socket/SimpleSocketPluginFactory.java
+++ b/components/net/sf/briar/plugins/socket/SimpleSocketPluginFactory.java
@@ -1,6 +1,6 @@
 package net.sf.briar.plugins.socket;
 
-import java.util.concurrent.Executor;
+import java.util.concurrent.ScheduledExecutorService;
 
 import net.sf.briar.api.plugins.PluginExecutor;
 import net.sf.briar.api.plugins.StreamPlugin;
@@ -11,7 +11,8 @@ public class SimpleSocketPluginFactory implements StreamPluginFactory {
 
 	private static final long POLLING_INTERVAL = 5L * 60L * 1000L; // 5 mins
 
-	public StreamPlugin createPlugin(@PluginExecutor Executor pluginExecutor,
+	public StreamPlugin createPlugin(
+			@PluginExecutor ScheduledExecutorService pluginExecutor,
 			StreamPluginCallback callback) {
 		return new SimpleSocketPlugin(pluginExecutor, callback,
 				POLLING_INTERVAL);
diff --git a/components/net/sf/briar/plugins/socket/SocketPlugin.java b/components/net/sf/briar/plugins/socket/SocketPlugin.java
index c5001ef85f71d64b80ee531c17414530383bbac1..7f2a5557d234678563d71624b98a17b5133cc268 100644
--- a/components/net/sf/briar/plugins/socket/SocketPlugin.java
+++ b/components/net/sf/briar/plugins/socket/SocketPlugin.java
@@ -6,7 +6,7 @@ import java.net.Socket;
 import java.net.SocketAddress;
 import java.util.Collection;
 import java.util.Map;
-import java.util.concurrent.Executor;
+import java.util.concurrent.ScheduledExecutorService;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -22,7 +22,7 @@ abstract class SocketPlugin implements StreamPlugin {
 	private static final Logger LOG =
 		Logger.getLogger(SocketPlugin.class.getName());
 
-	protected final Executor pluginExecutor;
+	protected final ScheduledExecutorService pluginExecutor;
 	protected final StreamPluginCallback callback;
 
 	private final long pollingInterval;
@@ -37,7 +37,8 @@ abstract class SocketPlugin implements StreamPlugin {
 	protected abstract SocketAddress getLocalSocketAddress();
 	protected abstract SocketAddress getRemoteSocketAddress(ContactId c);
 
-	protected SocketPlugin(@PluginExecutor Executor pluginExecutor,
+	protected SocketPlugin(
+			@PluginExecutor ScheduledExecutorService pluginExecutor,
 			StreamPluginCallback callback, long pollingInterval) {
 		this.pluginExecutor = pluginExecutor;
 		this.callback = callback;
diff --git a/test/net/sf/briar/plugins/PluginManagerImplTest.java b/test/net/sf/briar/plugins/PluginManagerImplTest.java
index 3173f034498cba53fbd090c41c4f089c6118822e..48f47eb256d590e3b63b6ab6079ffa3cc5b25c31 100644
--- a/test/net/sf/briar/plugins/PluginManagerImplTest.java
+++ b/test/net/sf/briar/plugins/PluginManagerImplTest.java
@@ -1,8 +1,8 @@
 package net.sf.briar.plugins;
 
 import java.util.Collection;
-import java.util.concurrent.Executor;
 import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import net.sf.briar.BriarTestCase;
@@ -43,7 +43,7 @@ public class PluginManagerImplTest extends BriarTestCase {
 					with(any(TransportProperties.class)));
 			oneOf(poller).stopPolling();
 		}});
-		Executor executor = Executors.newCachedThreadPool();
+		ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
 		PluginManagerImpl p = new PluginManagerImpl(executor, db, poller,
 				dispatcher, uiCallback);
 		// We expect either 2 or 3 plugins to be started, depending on whether
diff --git a/test/net/sf/briar/plugins/bluetooth/BluetoothClientTest.java b/test/net/sf/briar/plugins/bluetooth/BluetoothClientTest.java
index 19f829756e78df1be093a16d158a6d0646b4fb53..234c6f850e4945926a75f837ade62ad9da6b65f3 100644
--- a/test/net/sf/briar/plugins/bluetooth/BluetoothClientTest.java
+++ b/test/net/sf/briar/plugins/bluetooth/BluetoothClientTest.java
@@ -2,8 +2,8 @@ package net.sf.briar.plugins.bluetooth;
 
 import java.util.Collections;
 import java.util.Map;
-import java.util.concurrent.Executor;
 import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
 
 import net.sf.briar.api.ContactId;
 import net.sf.briar.api.TransportConfig;
@@ -24,8 +24,8 @@ public class BluetoothClientTest extends StreamClientTest {
 		// Create the plugin
 		callback = new ClientCallback(new TransportConfig(),
 				new TransportProperties(), remote);
-		Executor e = Executors.newCachedThreadPool();
-		plugin = new BluetoothPlugin(e, callback, 0L);
+		ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
+		plugin = new BluetoothPlugin(executor, callback, 0L);
 	}
 
 	public static void main(String[] args) throws Exception {
diff --git a/test/net/sf/briar/plugins/bluetooth/BluetoothServerTest.java b/test/net/sf/briar/plugins/bluetooth/BluetoothServerTest.java
index c538c29fca60228387b1a8ffc18085896c2f857b..6b73adf3bee66f04c04ea25e89de4e8e534b14b0 100644
--- a/test/net/sf/briar/plugins/bluetooth/BluetoothServerTest.java
+++ b/test/net/sf/briar/plugins/bluetooth/BluetoothServerTest.java
@@ -1,8 +1,8 @@
 package net.sf.briar.plugins.bluetooth;
 
 import java.util.Collections;
-import java.util.concurrent.Executor;
 import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
 
 import net.sf.briar.api.TransportConfig;
 import net.sf.briar.api.TransportProperties;
@@ -19,8 +19,8 @@ public class BluetoothServerTest extends StreamServerTest {
 		// Create the plugin
 		callback = new ServerCallback(new TransportConfig(), local,
 				Collections.singletonMap(contactId, new TransportProperties()));
-		Executor e = Executors.newCachedThreadPool();
-		plugin = new BluetoothPlugin(e, callback, 0L);
+		ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
+		plugin = new BluetoothPlugin(executor, callback, 0L);
 	}
 
 	public static void main(String[] args) throws Exception {
diff --git a/test/net/sf/briar/plugins/socket/LanSocketClientTest.java b/test/net/sf/briar/plugins/socket/LanSocketClientTest.java
index 92710c5a64e1bfbd442465d756f70599201719b9..a093f30e30c5ab004320023bc28ee26b68c6eadd 100644
--- a/test/net/sf/briar/plugins/socket/LanSocketClientTest.java
+++ b/test/net/sf/briar/plugins/socket/LanSocketClientTest.java
@@ -2,8 +2,8 @@ package net.sf.briar.plugins.socket;
 
 import java.util.Collections;
 import java.util.Map;
-import java.util.concurrent.Executor;
 import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
 
 import net.sf.briar.api.ContactId;
 import net.sf.briar.api.TransportConfig;
@@ -24,8 +24,8 @@ public class LanSocketClientTest extends StreamClientTest {
 		// Create the plugin
 		callback = new ClientCallback(new TransportConfig(),
 				new TransportProperties(), remote);
-		Executor e = Executors.newCachedThreadPool();
-		plugin = new LanSocketPlugin(e, callback, 0L);
+		ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
+		plugin = new LanSocketPlugin(executor, callback, 0L);
 	}
 
 	public static void main(String[] args) throws Exception {
diff --git a/test/net/sf/briar/plugins/socket/LanSocketServerTest.java b/test/net/sf/briar/plugins/socket/LanSocketServerTest.java
index 0535bd93e10342ada486504435f5ab7e21578719..d46544cc4b43f1ad8b914f6ce59f55af622cf27f 100644
--- a/test/net/sf/briar/plugins/socket/LanSocketServerTest.java
+++ b/test/net/sf/briar/plugins/socket/LanSocketServerTest.java
@@ -1,8 +1,8 @@
 package net.sf.briar.plugins.socket;
 
 import java.util.Collections;
-import java.util.concurrent.Executor;
 import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
 
 import net.sf.briar.api.TransportConfig;
 import net.sf.briar.api.TransportProperties;
@@ -16,8 +16,8 @@ public class LanSocketServerTest extends StreamServerTest {
 		callback = new ServerCallback(new TransportConfig(),
 				new TransportProperties(),
 				Collections.singletonMap(contactId, new TransportProperties()));
-		Executor e = Executors.newCachedThreadPool();
-		plugin = new LanSocketPlugin(e, callback, 0L);
+		ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
+		plugin = new LanSocketPlugin(executor, callback, 0L);
 	}
 
 	public static void main(String[] args) throws Exception {
diff --git a/test/net/sf/briar/plugins/socket/SimpleSocketPluginTest.java b/test/net/sf/briar/plugins/socket/SimpleSocketPluginTest.java
index 238a53152010b4b2b67abd48644ed86659f9f02f..4387b93556be888a5c06a1e104e63242761a0fdd 100644
--- a/test/net/sf/briar/plugins/socket/SimpleSocketPluginTest.java
+++ b/test/net/sf/briar/plugins/socket/SimpleSocketPluginTest.java
@@ -8,6 +8,7 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 
@@ -29,8 +30,8 @@ public class SimpleSocketPluginTest extends BriarTestCase {
 		StreamCallback callback = new StreamCallback();
 		callback.local.put("internal", "127.0.0.1");
 		callback.local.put("port", "0");
-		SimpleSocketPlugin plugin = new SimpleSocketPlugin(
-				Executors.newCachedThreadPool(), callback, 0L);
+		ScheduledExecutorService e = Executors.newScheduledThreadPool(1);
+		SimpleSocketPlugin plugin = new SimpleSocketPlugin(e, callback, 0L);
 		plugin.start();
 		// The plugin should have bound a socket and stored the port number
 		callback.latch.await(1, TimeUnit.SECONDS);
@@ -63,8 +64,8 @@ public class SimpleSocketPluginTest extends BriarTestCase {
 	@Test
 	public void testOutgoingConnection() throws Exception {
 		StreamCallback callback = new StreamCallback();
-		SimpleSocketPlugin plugin = new SimpleSocketPlugin(
-				Executors.newCachedThreadPool(), callback, 0L);
+		ScheduledExecutorService e = Executors.newScheduledThreadPool(1);
+		SimpleSocketPlugin plugin = new SimpleSocketPlugin(e, callback, 0L);
 		plugin.start();
 		// Listen on a local port
 		final ServerSocket ss = new ServerSocket();