Dodge the BSD bug with toStringing a channel.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3480 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -280,8 +280,13 @@ public abstract class Connection implements NetEventHandler
|
|||||||
close();
|
close();
|
||||||
|
|
||||||
} catch (ClassNotFoundException cnfe) {
|
} catch (ClassNotFoundException cnfe) {
|
||||||
Log.warning("Error reading message from socket " +
|
try {
|
||||||
"[channel=" + _channel + ", error=" + cnfe + "].");
|
Log.warning("Error reading message from socket " +
|
||||||
|
"[channel=" + _channel + ", error=" + cnfe + "].");
|
||||||
|
} catch (Error err) {
|
||||||
|
Log.warning("Error reading message from socket " +
|
||||||
|
"and error printing channel [error=" + cnfe + "].");
|
||||||
|
}
|
||||||
// deal with the failure
|
// deal with the failure
|
||||||
handleFailure(new NestableIOException(
|
handleFailure(new NestableIOException(
|
||||||
"Unable to decode incoming message.", cnfe));
|
"Unable to decode incoming message.", cnfe));
|
||||||
@@ -291,8 +296,14 @@ public abstract class Connection implements NetEventHandler
|
|||||||
// dropped the connection" failure
|
// dropped the connection" failure
|
||||||
String msg = ioe.getMessage();
|
String msg = ioe.getMessage();
|
||||||
if (msg == null || msg.indexOf("reset by peer") == -1) {
|
if (msg == null || msg.indexOf("reset by peer") == -1) {
|
||||||
Log.warning("Error reading message from socket " +
|
try {
|
||||||
"[channel=" + _channel + ", error=" + ioe + "].");
|
Log.warning("Error reading message from socket " +
|
||||||
|
"[channel=" + _channel +
|
||||||
|
", error=" + ioe + "].");
|
||||||
|
} catch (Error err) {
|
||||||
|
Log.warning("Error reading message from socket " +
|
||||||
|
"and error printing channel [error=" + ioe + "].");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// deal with the failure
|
// deal with the failure
|
||||||
handleFailure(ioe);
|
handleFailure(ioe);
|
||||||
|
|||||||
@@ -583,9 +583,14 @@ public class ConnectionManager extends LoopingThread
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!(channel instanceof SelectableChannel)) {
|
if (!(channel instanceof SelectableChannel)) {
|
||||||
Log.warning("Provided with un-selectable socket as " +
|
try {
|
||||||
"result of accept(), can't cope " +
|
Log.warning("Provided with un-selectable socket as " +
|
||||||
"[channel=" + channel + "].");
|
"result of accept(), can't cope " +
|
||||||
|
"[channel=" + channel + "].");
|
||||||
|
} catch (Error err) {
|
||||||
|
Log.warning("Un-selectable channel also couldn't " +
|
||||||
|
"be printed.");
|
||||||
|
}
|
||||||
// stick a fork in the socket
|
// stick a fork in the socket
|
||||||
channel.socket().close();
|
channel.socket().close();
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user