Modified behavior of shutdownInput() and shutdownOutput() to always shutdown either input or output.
Calling socket.close() does not imply that socket.isInputShutdown() returns true, so there was a possibility that code was calling ChannelEndPoint.shutdownInput(), but the input was not really shutdown, and a subsequent call to ChannelEndPoint.isInputShutdown() returned false.
This commit is contained in:
parent
f01877e738
commit
f1251412e4
|
@ -112,10 +112,18 @@ public class ChannelEndPoint implements EndPoint
|
||||||
Socket socket= ((SocketChannel)_channel).socket();
|
Socket socket= ((SocketChannel)_channel).socket();
|
||||||
if (!socket.isClosed())
|
if (!socket.isClosed())
|
||||||
{
|
{
|
||||||
if(socket.isOutputShutdown())
|
|
||||||
socket.close();
|
try
|
||||||
else if (!socket.isInputShutdown())
|
{
|
||||||
socket.shutdownInput();
|
if (!socket.isInputShutdown())
|
||||||
|
socket.shutdownInput();
|
||||||
|
if (socket.isOutputShutdown())
|
||||||
|
socket.close();
|
||||||
|
}
|
||||||
|
catch (SocketException e)
|
||||||
|
{
|
||||||
|
LOG.ignore(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -132,12 +140,12 @@ public class ChannelEndPoint implements EndPoint
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
if (!socket.isOutputShutdown())
|
||||||
|
socket.shutdownOutput();
|
||||||
if (socket.isInputShutdown())
|
if (socket.isInputShutdown())
|
||||||
socket.close();
|
socket.close();
|
||||||
else if (!socket.isOutputShutdown())
|
|
||||||
socket.shutdownOutput();
|
|
||||||
}
|
}
|
||||||
catch(SocketException e)
|
catch (SocketException e)
|
||||||
{
|
{
|
||||||
LOG.ignore(e);
|
LOG.ignore(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue