maintain own ishut status
This commit is contained in:
parent
a8173e3d12
commit
9ac9a1d687
|
@ -44,6 +44,7 @@ public class ChannelEndPoint implements EndPoint
|
||||||
protected final InetSocketAddress _local;
|
protected final InetSocketAddress _local;
|
||||||
protected final InetSocketAddress _remote;
|
protected final InetSocketAddress _remote;
|
||||||
protected int _maxIdleTime;
|
protected int _maxIdleTime;
|
||||||
|
private boolean _ishut;
|
||||||
|
|
||||||
public ChannelEndPoint(ByteChannel channel) throws IOException
|
public ChannelEndPoint(ByteChannel channel) throws IOException
|
||||||
{
|
{
|
||||||
|
@ -126,17 +127,16 @@ public class ChannelEndPoint implements EndPoint
|
||||||
// System.err.println(e);
|
// System.err.println(e);
|
||||||
LOG.debug(e.toString());
|
LOG.debug(e.toString());
|
||||||
LOG.ignore(e);
|
LOG.ignore(e);
|
||||||
if (!_socket.isClosed())
|
|
||||||
close();
|
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
_ishut=true;
|
||||||
if(_socket.isOutputShutdown() && !_socket.isClosed())
|
if(_socket.isOutputShutdown() && !_socket.isClosed())
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
close();
|
_ishut=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ public class ChannelEndPoint implements EndPoint
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
if (_socket.isInputShutdown() && !_socket.isClosed())
|
if ((_ishut||_socket.isInputShutdown()) && !_socket.isClosed())
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -196,7 +196,7 @@ public class ChannelEndPoint implements EndPoint
|
||||||
|
|
||||||
public boolean isInputShutdown()
|
public boolean isInputShutdown()
|
||||||
{
|
{
|
||||||
return !_channel.isOpen() || _socket!=null && _socket.isInputShutdown();
|
return !_channel.isOpen() || _ishut || _socket!=null && _socket.isInputShutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
|
Loading…
Reference in New Issue