public final class FragmentationDuplexConnection extends ReassemblyDuplexConnection implements DuplexConnection
DuplexConnection
implementation that fragments and reassembles ByteBuf
s.Disposable.Composite, Disposable.Swap
Modifier and Type | Field and Description |
---|---|
static int |
MIN_MTU_SIZE |
Constructor and Description |
---|
FragmentationDuplexConnection(DuplexConnection delegate,
int mtu,
String type)
Class constructor.
|
Modifier and Type | Method and Description |
---|---|
static int |
assertMtu(int mtu) |
Mono<Void> |
send(org.reactivestreams.Publisher<ByteBuf> frames)
Sends the source of Frames on this connection and returns the
Publisher representing
the result of this send. |
Mono<Void> |
sendOne(ByteBuf frame)
Sends a single
Frame on this connection and returns the Publisher representing
the result of this send. |
alloc, dispose, onClose, receive
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
alloc, availability, receive
dispose, isDisposed
public static final int MIN_MTU_SIZE
public FragmentationDuplexConnection(DuplexConnection delegate, int mtu, String type)
delegate
- the underlying connectionmtu
- the fragment size, greater than MIN_MTU_SIZE
type
- a label to use for logging purposespublic static int assertMtu(int mtu)
public Mono<Void> send(org.reactivestreams.Publisher<ByteBuf> frames)
DuplexConnection
Publisher
representing
the result of this send.
Flow control
The passed Publisher
must
send
in interface DuplexConnection
send
in class ReassemblyDuplexConnection
frames
- Stream of Frame
s to send on the connection.Publisher
that completes when all the frames are written on the connection
successfully and errors when it fails.public Mono<Void> sendOne(ByteBuf frame)
DuplexConnection
Frame
on this connection and returns the Publisher
representing
the result of this send.sendOne
in interface DuplexConnection
sendOne
in class ReassemblyDuplexConnection
frame
- Frame
to send.Publisher
that completes when the frame is written on the connection
successfully and errors when it fails.