Assuming that socket is Socket which may or may not be closed or connected and inputStream = socket.getInputStream().
How is it possible for inputStream.read() to throw this error?
Shouldn't the if statement catch this?
-Greg :-Q
Code:
if (socket.isClosed() || !socket.isConnected())
{
return null;
}
try
{
i = inputStream.read();
}
catch (Exception e)
{
System.out.println(e.printStackTrace());
return null;
}
How is it possible for inputStream.read() to throw this error?
Code:
java.net.SocketException: Socket closed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.net.SocketInputStream.read(SocketInputStream.java:182)
Shouldn't the if statement catch this?
-Greg :-Q