use of io.aklivity.zilla.runtime.binding.tls.internal.types.stream.BeginFW in project zilla by aklivity.
the class TlsProxyFactory method doBegin.
private void doBegin(MessageConsumer receiver, long routeId, long streamId, long sequence, long acknowledge, int maximum, long traceId, long authorization, long affinity, Consumer<OctetsFW.Builder> extension) {
final BeginFW begin = beginRW.wrap(writeBuffer, 0, writeBuffer.capacity()).routeId(routeId).streamId(streamId).sequence(sequence).acknowledge(acknowledge).maximum(maximum).traceId(traceId).authorization(authorization).affinity(affinity).extension(extension).build();
receiver.accept(begin.typeId(), begin.buffer(), begin.offset(), begin.sizeof());
}
use of io.aklivity.zilla.runtime.binding.tls.internal.types.stream.BeginFW in project zilla by aklivity.
the class TlsServerFactory method newStream.
private MessageConsumer newStream(MessageConsumer sender, long routeId, long streamId, long sequence, long acknowledge, int maximum, long traceId, long authorization, long affinity, Consumer<OctetsFW.Builder> extension) {
final BeginFW begin = beginRW.wrap(writeBuffer, 0, writeBuffer.capacity()).routeId(routeId).streamId(streamId).sequence(sequence).acknowledge(acknowledge).maximum(maximum).traceId(traceId).authorization(authorization).affinity(affinity).extension(extension).build();
MessageConsumer receiver = streamFactory.newStream(begin.typeId(), begin.buffer(), begin.offset(), begin.sizeof(), sender);
receiver.accept(begin.typeId(), begin.buffer(), begin.offset(), begin.sizeof());
return receiver;
}
use of io.aklivity.zilla.runtime.binding.tls.internal.types.stream.BeginFW in project zilla by aklivity.
the class TlsClientFactory method newStream.
private MessageConsumer newStream(MessageConsumer sender, long routeId, long streamId, long sequence, long acknowledge, int maximum, long traceId, long authorization, long affinity, Consumer<OctetsFW.Builder> extension) {
final BeginFW begin = beginRW.wrap(writeBuffer, 0, writeBuffer.capacity()).routeId(routeId).streamId(streamId).sequence(sequence).acknowledge(acknowledge).maximum(maximum).traceId(traceId).authorization(authorization).affinity(affinity).extension(extension).build();
MessageConsumer receiver = streamFactory.newStream(begin.typeId(), begin.buffer(), begin.offset(), begin.sizeof(), sender);
receiver.accept(begin.typeId(), begin.buffer(), begin.offset(), begin.sizeof());
return receiver;
}
use of io.aklivity.zilla.runtime.binding.tls.internal.types.stream.BeginFW in project zilla by aklivity.
the class TlsClientFactory method doBegin.
private void doBegin(MessageConsumer receiver, long routeId, long streamId, long sequence, long acknowledge, int maximum, long traceId, long authorization, long affinity, Consumer<OctetsFW.Builder> extension) {
final BeginFW begin = beginRW.wrap(writeBuffer, 0, writeBuffer.capacity()).routeId(routeId).streamId(streamId).sequence(sequence).acknowledge(acknowledge).maximum(maximum).traceId(traceId).authorization(authorization).affinity(affinity).extension(extension).build();
receiver.accept(begin.typeId(), begin.buffer(), begin.offset(), begin.sizeof());
}
use of io.aklivity.zilla.runtime.binding.tls.internal.types.stream.BeginFW in project zilla by aklivity.
the class TlsProxyFactory method newStream.
@Override
public MessageConsumer newStream(int msgTypeId, DirectBuffer buffer, int index, int length, MessageConsumer net) {
final BeginFW begin = beginRO.wrap(buffer, index, index + length);
final long routeId = begin.routeId();
final long initialId = begin.streamId();
final long authorization = begin.authorization();
TlsBindingConfig binding = bindings.get(routeId);
MessageConsumer newStream = null;
if (binding != null && (!binding.routes.isEmpty() || binding.exit != null)) {
newStream = new TlsProxy(net, routeId, initialId, authorization)::onNetMessage;
}
return newStream;
}
Aggregations