Exemplo n.º 1
0
  public ClientProxy(final BroadcastTransmitter transmitter) {
    this.transmitter = transmitter;

    errorResponse.wrap(buffer, 0);
    imageReady.wrap(buffer, 0);
    publicationReady.wrap(buffer, 0);
    correlatedMessage.wrap(buffer, 0);
    imageMessage.wrap(buffer, 0);
  }
Exemplo n.º 2
0
  public void onAvailableImage(
      final long correlationId,
      final int streamId,
      final int sessionId,
      final String logFileName,
      final List<SubscriberPosition> subscriberPositions,
      final String sourceIdentity) {
    imageReady.sessionId(sessionId).streamId(streamId).correlationId(correlationId);

    final int size = subscriberPositions.size();
    imageReady.subscriberPositionCount(size);
    for (int i = 0; i < size; i++) {
      final SubscriberPosition position = subscriberPositions.get(i);
      imageReady.subscriberPositionId(i, position.positionCounterId());
      imageReady.positionIndicatorRegistrationId(i, position.subscription().registrationId());
    }

    imageReady.logFileName(logFileName).sourceIdentity(sourceIdentity);

    final int length = imageReady.length();
    transmit(ON_AVAILABLE_IMAGE, buffer, 0, length);
  }