public class ResumableDuplexConnection extends Flux<ByteBuf> implements DuplexConnection, org.reactivestreams.Subscription
Disposable.Composite, Disposable.Swap| Constructor and Description |
|---|
ResumableDuplexConnection(String side,
ByteBuf session,
DuplexConnection initialConnection,
ResumableFramesStore resumableFramesStore) |
| Modifier and Type | Method and Description |
|---|---|
ByteBufAllocator |
alloc()
Returns the assigned
ByteBufAllocator. |
void |
cancel() |
boolean |
connect(DuplexConnection nextConnection) |
void |
disconnect() |
void |
dispose() |
boolean |
isDisposed() |
Mono<Void> |
onClose()
Returns a
Mono that terminates when the instance is terminated by any reason. |
Flux<ByteBuf> |
receive()
Returns a stream of all
Frames received on this connection. |
SocketAddress |
remoteAddress()
Return the remote address that this connection is connected to.
|
void |
request(long n) |
void |
sendErrorAndClose(RSocketErrorException rSocketErrorException)
Send an error frame and after it is successfully sent, close the connection.
|
void |
sendFrame(int streamId,
ByteBuf frame)
Delivers the given frame to the underlying transport connection.
|
void |
subscribe(CoreSubscriber<? super ByteBuf> receiverSubscriber) |
String |
toString() |
all, any, as, blockFirst, blockFirst, blockLast, blockLast, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, bufferTimeout, bufferTimeout, bufferTimeout, bufferTimeout, bufferUntil, bufferUntil, bufferUntilChanged, bufferUntilChanged, bufferUntilChanged, bufferWhen, bufferWhen, bufferWhile, cache, cache, cache, cache, cache, cache, cancelOn, cast, checkpoint, checkpoint, checkpoint, collect, collect, collectList, collectMap, collectMap, collectMap, collectMultimap, collectMultimap, collectMultimap, collectSortedList, collectSortedList, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, concat, concat, concat, concat, concatDelayError, concatDelayError, concatDelayError, concatDelayError, concatMap, concatMap, concatMapDelayError, concatMapDelayError, concatMapDelayError, concatMapIterable, concatMapIterable, concatWith, concatWithValues, contextWrite, contextWrite, count, create, create, defaultIfEmpty, defer, deferContextual, deferWithContext, delayElements, delayElements, delaySequence, delaySequence, delaySubscription, delaySubscription, delaySubscription, delayUntil, dematerialize, distinct, distinct, distinct, distinct, distinctUntilChanged, distinctUntilChanged, distinctUntilChanged, doAfterTerminate, doFinally, doFirst, doOnCancel, doOnComplete, doOnDiscard, doOnEach, doOnError, doOnError, doOnError, doOnNext, doOnRequest, doOnSubscribe, doOnTerminate, elapsed, elapsed, elementAt, elementAt, empty, error, error, error, expand, expand, expandDeep, expandDeep, filter, filterWhen, filterWhen, first, first, firstWithSignal, firstWithSignal, firstWithValue, firstWithValue, flatMap, flatMap, flatMap, flatMap, flatMapDelayError, flatMapIterable, flatMapIterable, flatMapSequential, flatMapSequential, flatMapSequential, flatMapSequentialDelayError, from, fromArray, fromIterable, fromStream, fromStream, generate, generate, generate, getPrefetch, groupBy, groupBy, groupBy, groupBy, groupJoin, handle, hasElement, hasElements, hide, ignoreElements, index, index, interval, interval, interval, interval, join, just, just, last, last, limitRate, limitRate, limitRequest, log, log, log, log, log, log, map, mapNotNull, materialize, merge, merge, merge, merge, merge, merge, mergeComparing, mergeComparing, mergeComparing, mergeComparingDelayError, mergeComparingWith, mergeDelayError, mergeOrdered, mergeOrdered, mergeOrdered, mergeOrderedWith, mergePriority, mergePriority, mergePriority, mergePriorityDelayError, mergeSequential, mergeSequential, mergeSequential, mergeSequential, mergeSequential, mergeSequential, mergeSequentialDelayError, mergeSequentialDelayError, mergeSequentialDelayError, mergeWith, metrics, name, never, next, ofType, onAssembly, onAssembly, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureDrop, onBackpressureDrop, onBackpressureError, onBackpressureLatest, onErrorComplete, onErrorComplete, onErrorComplete, onErrorContinue, onErrorContinue, onErrorContinue, onErrorMap, onErrorMap, onErrorMap, onErrorResume, onErrorResume, onErrorResume, onErrorReturn, onErrorReturn, onErrorReturn, onErrorStop, onTerminateDetach, or, parallel, parallel, parallel, publish, publish, publish, publish, publishNext, publishOn, publishOn, publishOn, push, push, range, reduce, reduce, reduceWith, repeat, repeat, repeat, repeat, repeatWhen, replay, replay, replay, replay, replay, replay, retry, retry, retryWhen, sample, sample, sampleFirst, sampleFirst, sampleTimeout, sampleTimeout, scan, scan, scanWith, share, shareNext, single, single, singleOrEmpty, skip, skip, skip, skipLast, skipUntil, skipUntilOther, skipWhile, sort, sort, startWith, startWith, startWith, subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribeOn, subscribeOn, subscriberContext, subscriberContext, subscribeWith, switchIfEmpty, switchMap, switchMap, switchOnFirst, switchOnFirst, switchOnNext, switchOnNext, tag, take, take, take, take, takeLast, takeUntil, takeUntilOther, takeWhile, then, then, thenEmpty, thenMany, timed, timed, timeout, timeout, timeout, timeout, timeout, timeout, timeout, timestamp, timestamp, toIterable, toIterable, toIterable, toStream, toStream, transform, transformDeferred, transformDeferredContextual, using, using, usingWhen, usingWhen, window, window, window, window, window, window, window, windowTimeout, windowTimeout, windowTimeout, windowTimeout, windowUntil, windowUntil, windowUntil, windowUntilChanged, windowUntilChanged, windowUntilChanged, windowWhen, windowWhile, windowWhile, withLatestFrom, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zipWith, zipWith, zipWith, zipWith, zipWithIterable, zipWithIterableclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitavailabilitypublic ResumableDuplexConnection(String side, ByteBuf session, DuplexConnection initialConnection, ResumableFramesStore resumableFramesStore)
public boolean connect(DuplexConnection nextConnection)
public void disconnect()
public void sendFrame(int streamId,
ByteBuf frame)
DuplexConnectionsendFrame in interface DuplexConnectionstreamId - to which the given frame relatesframe - with the encoded contentpublic void sendErrorAndClose(RSocketErrorException rSocketErrorException)
DuplexConnectionsendErrorAndClose in interface DuplexConnectionrSocketErrorException - to encode in the error framepublic Flux<ByteBuf> receive()
DuplexConnectionFrames received on this connection.
Completion
Returned Publisher MUST never emit a completion event (Subscriber.onComplete()).
Error
Returned Publisher can error with various transport errors. If the underlying
physical connection is closed by the peer, then the returned stream from here MUST
emit an ClosedChannelException.
Multiple Subscriptions
Returned Publisher is not required to support multiple concurrent subscriptions.
RSocket will never have multiple subscriptions to this source. Implementations MUST
emit an IllegalStateException for subsequent concurrent subscriptions, if they do not
support multiple concurrent subscriptions.
receive in interface DuplexConnectionFrames received.public ByteBufAllocator alloc()
DuplexConnectionByteBufAllocator.alloc in interface DuplexConnectionByteBufAllocatorpublic Mono<Void> onClose()
CloseableMono that terminates when the instance is terminated by any reason. Note, in
case of error termination, the cause of error will be propagated as an error signal through
Subscriber.onError(Throwable). Otherwise, Subscriber.onComplete() will be called.public void dispose()
dispose in interface Disposablepublic boolean isDisposed()
isDisposed in interface Disposablepublic SocketAddress remoteAddress()
DuplexConnectionSocketAddress varies by transport type and should be downcast to obtain more detailed
information. For TCP and WebSocket, the address type is InetSocketAddress. For
local transport, it is io.rsocket.transport.local.LocalSocketAddress.remoteAddress in interface DuplexConnectionpublic void request(long n)
request in interface org.reactivestreams.Subscriptionpublic void cancel()
cancel in interface org.reactivestreams.Subscriptionpublic void subscribe(CoreSubscriber<? super ByteBuf> receiverSubscriber)