return (queue==null)?false:queue.checkIdleKeepAlive();
}
+ @Override
public void add(Member member) {
// no op, senders created upon demands
}
+ @Override
public void remove(Member member) {
//no op for now, should not cancel out any keys
//can create serious sync issues
}
// ----------------------------------------------------- Inner Class
- private class SenderQueue {
+ private static class SenderQueue {
private int limit = 25;
PooledSender parent = null;
setListen(false);
try {
this.serverSocket.close();
- } catch (Exception x) {/* Ignore */}
+ } catch (Exception x) {
+ if (log.isDebugEnabled()) {
+ log.debug("Failed to close socket", x);
+ }
+ }
super.stop();
}
} catch ( Exception x ) {
log.error("Unable to service bio socket", x);
}finally {
- try {socket.close();}catch ( Exception e){/* Ignore */}
- try {reader.close();}catch ( Exception e){/* Ignore */}
+ try {
+ socket.close();
+ }catch (Exception e) {
+ if (log.isDebugEnabled()) {
+ log.debug("Failed to close socket", e);
+ }
+ }
+ try {
+ reader.close();
+ }catch (Exception e) {
+ if (log.isDebugEnabled()) {
+ log.debug("Failed to close reader", e);
+ }
+ }
reader = null;
socket = null;
}
@Override
public void close() {
setDoRun(false);
- try {socket.close();}catch ( Exception e){/* Ignore */}
- try {reader.close();}catch ( Exception e){/* Ignore */}
+ try {
+ socket.close();
+ }catch (Exception e) {
+ if (log.isDebugEnabled()) {
+ log.debug("Failed to close socket", e);
+ }
+ }
+ try {
+ reader.close();
+ }catch (Exception e) {
+ if (log.isDebugEnabled()) {
+ log.debug("Failed to close reader", e);
+ }
+ }
reader = null;
socket = null;
super.close();
@Override
public void finalize() {
try {disconnect(); }catch ( Exception e){/*Ignore*/}
- try {selector.close();} catch (Exception e) {/*Ignore*/}
+ try {
+ selector.close();
+ }catch (Exception e) {
+ if (log.isDebugEnabled()) {
+ log.debug("Failed to close selector", e);
+ }
+ }
}
@Override
if (ka!=null) handler.release(ka.getChannel());
else handler.release((SocketChannel)key.channel());
if (key.isValid()) key.cancel();
- if (key.channel().isOpen()) try {key.channel().close();}catch (Exception ignore){}
- try {if (ka!=null) ka.getSocket().close(true);}catch (Exception ignore){}
+ if (key.channel().isOpen()) {
+ try {
+ key.channel().close();
+ } catch (Exception e) {
+ if (log.isDebugEnabled()) {
+ log.debug(sm.getString(
+ "endpoint.debug.channelCloseFail"), e);
+ }
+ }
+ }
+ try {
+ if (ka!=null) {
+ ka.getSocket().close(true);
+ }
+ } catch (Exception e){
+ if (log.isDebugEnabled()) {
+ log.debug(sm.getString(
+ "endpoint.debug.socketCloseFail"), e);
+ }
+ }
try {if (ka!=null && ka.getSendfileData()!=null && ka.getSendfileData().fchannel!=null && ka.getSendfileData().fchannel.isOpen()) ka.getSendfileData().fchannel.close();}catch (Exception ignore){}
if (ka!=null) {
ka.reset();
}
} catch (Throwable e) {
ExceptionUtils.handleThrowable(e);
- if ( log.isDebugEnabled() ) log.error("",e);
- // Ignore
+ if (log.isDebugEnabled()) log.error("",e);
}
}
/**
endpoint.sendfile.nosupport=Disabling sendfile, since either the APR version or the system doesn't support it
endpoint.warn.noInsecureReneg=Secure renegotation is not supported by the SSL library {0}
endpoint.warn.unlockAcceptorFailed=Acceptor thread [{0}] failed to unlock. Forcing hard socket shutdown.
+endpoint.debug.channelCloseFail=Failed to close channel
+endpoint.debug.socketCloseFail=Failed to close socket