class AbstractOpWithTimeout extends AbstractOp {

  @Override
  public Object attempt(final Connection connection) throws Exception {
    final Socket socket = connection.getSocket();
    final int previousTimeoutMs = socket.getSoTimeout();
    final int timeoutMs = getTimeoutMs();
    final boolean changeTimeout = previousTimeoutMs != timeoutMs;
    if (changeTimeout) {
      socket.setSoTimeout(timeoutMs);
    }
    try {
      return super.attempt(connection);
    } finally {
      if (changeTimeout) {
        socket.setSoTimeout(previousTimeoutMs);
      }
    }
  }

    AbstractOpWithTimeout(int msgType, int msgParts, int timeoutMs);

}