Index: simplerunner/src/main/java/geniusweb/simplerunner/BasicConnection.java
===================================================================
--- simplerunner/src/main/java/geniusweb/simplerunner/BasicConnection.java	(revision 33)
+++ simplerunner/src/main/java/geniusweb/simplerunner/BasicConnection.java	(revision 34)
@@ -82,5 +82,5 @@
 	 */
 	protected synchronized void setError(Throwable e) {
-		if (error != null) {
+		if (error == null) {
 			// maybe log instead?
 			e.printStackTrace();
@@ -137,8 +137,9 @@
 	/**
 	 * 
-	 * @return true iff this connection is open
+	 * @return true iff this connection is open. Returns false also when then
+	 *         handler is in the close-down process
 	 */
 	public boolean isOpen() {
-		return handler != null;
+		return handler != null && !messages.contains(EOS);
 	}
 
Index: simplerunner/src/main/java/geniusweb/simplerunner/ClassPathConnectionFactory.java
===================================================================
--- simplerunner/src/main/java/geniusweb/simplerunner/ClassPathConnectionFactory.java	(revision 33)
+++ simplerunner/src/main/java/geniusweb/simplerunner/ClassPathConnectionFactory.java	(revision 34)
@@ -109,8 +109,11 @@
 		party2protocol = new BasicConnection<Inform, Action>(reference,
 				PROTOCOLURI) {
+
 			@Override
-			protected synchronized void setError(Throwable e) {
-				super.setError(e); // closes party2protocol
-				protocol2party.close();
+			public void close() {
+				if (isOpen()) {
+					super.close();
+					protocol2party.close();
+				}
 			}
 
@@ -123,7 +126,9 @@
 						+ "." + (serialcounter++))) {
 			@Override
-			protected synchronized void setError(Throwable e) {
-				super.setError(e); // closes protocol2party
-				party2protocol.close();
+			public void close() {
+				if (isOpen()) {
+					super.close();
+					party2protocol.close();
+				}
 			}
 
@@ -151,6 +156,13 @@
 	}
 
-	public ProtocolToPartyConn getProtocolToPartyConn() {
+	public BasicConnectionWithParty getProtocolToPartyConn() {
 		return protocol2party;
+	}
+
+	/**
+	 * Internal use for testing
+	 */
+	protected BasicConnection getPartyToProtocolConn() {
+		return party2protocol;
 	}
 
Index: simplerunner/src/test/java/geniusweb/simplerunner/ClassPathConnectionFactoryTest.java
===================================================================
--- simplerunner/src/test/java/geniusweb/simplerunner/ClassPathConnectionFactoryTest.java	(revision 33)
+++ simplerunner/src/test/java/geniusweb/simplerunner/ClassPathConnectionFactoryTest.java	(revision 34)
@@ -1,4 +1,5 @@
 package geniusweb.simplerunner;
 
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
@@ -16,8 +17,11 @@
 public class ClassPathConnectionFactoryTest {
 	private ClassPathConnectionFactory factory;
+	private PartyRef PARTYREF;
 
 	@Before
-	public void before() {
+	public void before() throws URISyntaxException {
 		factory = new ClassPathConnectionFactory();
+		PARTYREF = new PartyRef(
+				"classpath:geniusweb.exampleparties.randomparty.RandomParty");
 
 	}
@@ -41,8 +45,51 @@
 	@Test
 	public void testRandomParty() throws IOException, URISyntaxException {
-		ConnectionEnd<Action, Inform> party = factory.connect(new PartyRef(
-				"classpath:geniusweb.exampleparties.randomparty.RandomParty"));
+		ConnectionEnd<Action, Inform> party = factory.connect(PARTYREF);
 		assertNotNull(party);
 	}
 
+	@Test
+	public void testConnectionPairProtocolClosesNormally()
+			throws InterruptedException {
+		ConnectionPair cpair = new ConnectionPair(PARTYREF);
+		assertEquals(2, cpair.getOpenConnections().size());
+		cpair.getProtocolToPartyConn().close();
+		Thread.sleep(100);
+
+		assertEquals(0, cpair.getOpenConnections().size());
+
+	}
+
+	@Test
+	public void testConnectionPairProtocolClosesWithExc()
+			throws InterruptedException {
+		ConnectionPair cpair = new ConnectionPair(PARTYREF);
+		assertEquals(2, cpair.getOpenConnections().size());
+		cpair.getProtocolToPartyConn().setError(new Error("test"));
+		Thread.sleep(100);
+		assertEquals(0, cpair.getOpenConnections().size());
+	}
+
+	@Test
+	public void testConnectionPairPartyClosesNormally()
+			throws InterruptedException {
+		ConnectionPair cpair = new ConnectionPair(PARTYREF);
+		assertEquals(2, cpair.getOpenConnections().size());
+		cpair.getPartyToProtocolConn().close();
+		Thread.sleep(100);
+
+		assertEquals(0, cpair.getOpenConnections().size());
+
+	}
+
+	@Test
+	public void testConnectionPairPartyClosesWithExc()
+			throws InterruptedException {
+		ConnectionPair cpair = new ConnectionPair(PARTYREF);
+		assertEquals(2, cpair.getOpenConnections().size());
+		cpair.getPartyToProtocolConn().setError(new Error("test"));
+		Thread.sleep(100);
+		assertEquals(0, cpair.getOpenConnections().size());
+	}
+
 }
