class IdleAwareSocketWrapper extends SocketWrapper {

  public boolean hasData(long inactiveClientTimeOut) throws IOException {

    if (isClosed()) {
      throw new IOException("Socket is closed");
    }

    final InputStream inputStream = getInputStream();

    synchronized (inputStream) {
      if (inputStream.available() > 0) {
        m_idleStart = -1;
        return true;
      }

      final long now = m_timeAuthority.getTimeInMilliseconds();

      if (m_idleStart == -1) {
        m_idleStart = now;
      }
      else if (m_idleStart + inactiveClientTimeOut < now) {
        close();
      }

      return false;
    }
  }

  public  IdleAwareSocketWrapper(Socket socket,
                                TimeAuthority timeAuthority);

}