Treats ClosedChannelException as a fatal error and stops the Connector.

This commit is contained in:
boris 2014-10-02 13:15:20 +00:00
parent 868228b3f6
commit d937a29022
2 changed files with 14 additions and 0 deletions

View File

@ -8,6 +8,7 @@ package org.ice4j.stack;
import java.io.*;
import java.net.*;
import java.nio.channels.*;
import java.util.logging.*;
import org.ice4j.*;
@ -243,6 +244,18 @@ class Connector
//this.stop().
}
}
catch (ClosedChannelException cce)
{
logger.log(Level.WARNING,
"A net access point has gone useless:", cce);
stop();
errorHandler.handleFatalError(
this,
"ClosedChannelException occurred while listening"
+ " for messages!",
cce);
}
catch (IOException ex)
{
logger.log(Level.WARNING,

View File

@ -398,6 +398,7 @@ class NetAccessManager
/**
* Stops <tt>NetAccessManager</tt> and all of its <tt>MessageProcessor</tt>.
* TODO: close all connectors as well?
*/
public void stop()
{