SessionRemoteConnection

@RequiresApi(value = 26) interface SessionRemoteConnection


A connection to a remote device that is participating in a Session. This is a wrapper around RemoteConnection updated to be specific to SessionParticipant.

Summary

Public fields

abstract @NonNull SessionParticipant

The participant this this is a connection to.

Public methods

abstract void

Registers the given SessionConnectionReceiver with this channel.

abstract @NonNull Result<Unit>
send(@NonNull byte[] bytes)

See RemoteConnection.send

abstract @NonNull ListenableFuture<Void>
sendFuture(@NonNull byte[] bytes)

Java-compatible version of send.

abstract void

Unregisters a given receiver from the remote device.

Public fields

participant

abstract @NonNull SessionParticipant participant

The participant this this is a connection to.

Public methods

registerReceiver

abstract void registerReceiver(@NonNull SessionConnectionReceiver receiver)

Registers the given SessionConnectionReceiver with this channel.

Throws
com.google.ambient.crossdevice.connections.ConnectionsException com.google.ambient.crossdevice.connections.ConnectionsException

if the connection is closed.

send

abstract @NonNull Result<Unitsend(@NonNull byte[] bytes)

See RemoteConnection.send

sendFuture

abstract @NonNull ListenableFuture<VoidsendFuture(@NonNull byte[] bytes)

Java-compatible version of send.

unregisterReceiver

abstract void unregisterReceiver(@NonNull SessionConnectionReceiver receiver)

Unregisters a given receiver from the remote device.