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
This commit is contained in:
Michael Bayne
2009-07-13 00:22:24 +00:00
parent 4bcc8ab7c4
commit c6ba34a129
@@ -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