use of org.apache.qpid.server.protocol.v1_0.framing.OversizeFrameException in project qpid-broker-j by apache.
the class Session_1_0 method sendTransfer.
void sendTransfer(final Transfer xfr, final SendingLinkEndpoint endpoint) {
_nextOutgoingId.incr();
final boolean settled = Boolean.TRUE.equals(xfr.getSettled());
UnsignedInteger deliveryId = UnsignedInteger.valueOf(_nextOutgoingDeliveryId++);
xfr.setDeliveryId(deliveryId);
if (!settled) {
final UnsettledDelivery delivery = new UnsettledDelivery(xfr.getDeliveryTag(), endpoint);
_outgoingDeliveryRegistry.addDelivery(deliveryId, delivery);
}
_remoteIncomingWindow--;
try (QpidByteBuffer payload = xfr.getPayload()) {
long remaining = payload == null ? 0 : (long) payload.remaining();
int payloadSent = _connection.sendFrame(_sendingChannel, xfr, payload);
if (payload != null) {
while (payloadSent < remaining && payloadSent >= 0) {
Transfer continuationTransfer = new Transfer();
continuationTransfer.setHandle(xfr.getHandle());
continuationTransfer.setRcvSettleMode(xfr.getRcvSettleMode());
continuationTransfer.setState(xfr.getState());
continuationTransfer.setPayload(payload);
_nextOutgoingId.incr();
_remoteIncomingWindow--;
remaining = (long) payload.remaining();
payloadSent = _connection.sendFrame(_sendingChannel, continuationTransfer, payload);
continuationTransfer.dispose();
}
}
} catch (OversizeFrameException e) {
throw new ConnectionScopedRuntimeException(e);
}
}
Aggregations