Top Fields Constructors Methods
io.rsocket.core

pack-priv Class LoggingDuplexConnection

extends Object
implements DuplexConnection
Class Inheritance
All Implemented Interfaces
io.rsocket.DuplexConnection, io.rsocket.Closeable, reactor.core.Disposable, io.rsocket.Availability
Imports
io.netty.buffer.ByteBuf, .ByteBufAllocator, io.rsocket.DuplexConnection, .RSocketErrorException, io.rsocket.frame.FrameUtil, java.net.SocketAddress, org.slf4j.Logger, .LoggerFactory, reactor.core.publisher.Flux, .Mono

Field Summary

Modifier and TypeField and Description
private static final Logger
pack-priv final DuplexConnection

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public ByteBufAllocator
alloc()

Implements io.rsocket.DuplexConnection.alloc.

Returns the assigned ByteBufAllocator.
public void
dispose()

Implements reactor.core.Disposable.dispose.

Cancel or dispose the underlying task or resource.
public Mono<Void>
onClose()

Implements io.rsocket.Closeable.onClose.

Returns a Mono that terminates when the instance is terminated by any reason.
public Flux<ByteBuf>
receive()

Implements io.rsocket.DuplexConnection.receive.

Returns a stream of all Frames received on this connection.
public SocketAddress
remoteAddress()

Implements io.rsocket.DuplexConnection.remoteAddress.

Return the remote address that this connection is connected to.
public void
sendErrorAndClose(RSocketErrorException
to encode in the error frame
e
)

Implements io.rsocket.DuplexConnection.sendErrorAndClose.

Send an error frame and after it is successfully sent, close the connection.
public void
sendFrame(int
to which the given frame relates
streamId
,
ByteBuf
with the encoded content
frame
)

Implements io.rsocket.DuplexConnection.sendFrame.

Delivers the given frame to the underlying transport connection.
pack-priv static DuplexConnection
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGGERback to summary
private static final Logger LOGGER
sourceback to summary
pack-priv final DuplexConnection source

Constructor Detail

LoggingDuplexConnectionback to summary
pack-priv LoggingDuplexConnection(DuplexConnection source)

Method Detail

allocback to summary
public ByteBufAllocator alloc()

Implements io.rsocket.DuplexConnection.alloc.

Doc from io.rsocket.DuplexConnection.alloc.

Returns the assigned ByteBufAllocator.

Returns:ByteBufAllocator

the ByteBufAllocator

Annotations
@Override
disposeback to summary
public void dispose()

Implements reactor.core.Disposable.dispose.

Doc from reactor.core.Disposable.dispose.

Cancel or dispose the underlying task or resource.

Implementations are required to make this method idempotent.

Annotations
@Override
onCloseback to summary
public Mono<Void> onClose()

Implements io.rsocket.Closeable.onClose.

Doc from io.rsocket.Closeable.onClose.

Returns a Mono 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 org.reactivestreams.Subscriber#onError(Throwable). Otherwise, Subscriber#onComplete() will be called.

Returns:Mono<Void>

a Mono to track completion with success or error of the underlying resource. When the underlying resource is an `RSocket`, the Mono exposes stream 0 (i.e. connection level) errors.

Annotations
@Override
receiveback to summary
public Flux<ByteBuf> receive()

Implements io.rsocket.DuplexConnection.receive.

Doc from io.rsocket.DuplexConnection.receive.

Returns a stream of all Frames 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.

Returns:Flux<ByteBuf>

Stream of all Frames received.

Annotations
@Override
remoteAddressback to summary
public SocketAddress remoteAddress()

Implements io.rsocket.DuplexConnection.remoteAddress.

Doc from io.rsocket.DuplexConnection.remoteAddress.

Return the remote address that this connection is connected to. The returned SocketAddress varies by transport type and should be downcast to obtain more detailed information. For TCP and WebSocket, the address type is java.net.InetSocketAddress. For local transport, it is io.rsocket.transport.local.LocalSocketAddress.

Returns:SocketAddress

the address

Annotations
@Override
sendErrorAndCloseback to summary
public void sendErrorAndClose(RSocketErrorException e)

Implements io.rsocket.DuplexConnection.sendErrorAndClose.

Doc from io.rsocket.DuplexConnection.sendErrorAndClose.

Send an error frame and after it is successfully sent, close the connection.

Parameters
e:RSocketErrorException

to encode in the error frame

Annotations
@Override
sendFrameback to summary
public void sendFrame(int streamId, ByteBuf frame)

Implements io.rsocket.DuplexConnection.sendFrame.

Doc from io.rsocket.DuplexConnection.sendFrame.

Delivers the given frame to the underlying transport connection. This method is non-blocking and can be safely executed from multiple threads. This method does not provide any flow-control mechanism.

Parameters
streamId:int

to which the given frame relates

frame:ByteBuf

with the encoded content

Annotations
@Override
wrapIfEnabledback to summary
pack-priv static DuplexConnection wrapIfEnabled(DuplexConnection source)