Code example for IOException

0
      return inPacket;
    } catch( SocketTimeoutException e ) {
      //Do Nothing. 
    } catch (IOException e) {
      if (!socket.isClosed()) {
        throw new IOException(e);
      } 
    } 
    return null; 
  } 
 
  public void close() { 
    socket.close();
  } 
}