From c6ba34a129a1c13de77eb240ae0c14d827107005 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Mon, 13 Jul 2009 00:22:24 +0000 Subject: [PATCH] You'd think that calling isConnectionPending() would return true on a channel that would throw a NotYetConnectedException when you tried to write to it. Yes, you'd definitely think that. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5865 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/presents/server/net/ConnectionManager.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/java/com/threerings/presents/server/net/ConnectionManager.java b/src/java/com/threerings/presents/server/net/ConnectionManager.java index 572accbd5..d1b223126 100644 --- a/src/java/com/threerings/presents/server/net/ConnectionManager.java +++ b/src/java/com/threerings/presents/server/net/ConnectionManager.java @@ -33,6 +33,7 @@ import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.DatagramChannel; +import java.nio.channels.NotYetConnectedException; import java.nio.channels.SelectableChannel; import java.nio.channels.SelectionKey; import java.nio.channels.Selector; @@ -769,6 +770,11 @@ public class ConnectionManager extends LoopingThread pwh.handlePartialWrite(conn, _outbuf); } + } catch (NotYetConnectedException nyce) { + // this should be caught by isConnectionPending() but awesomely it's not + pwh.handlePartialWrite(conn, _outbuf); + return false; + } catch (IOException ioe) { conn.networkFailure(ioe); // instruct the connection to deal with its failure