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 functions

Unit

Registers the given SessionConnectionReceiver with this channel.

suspend Result<Unit>
send(bytes: ByteArray)

See RemoteConnection.send

ListenableFuture<Void?>

Java-compatible version of send.

Unit

Unregisters a given receiver from the remote device.

Public properties

SessionParticipant

The participant this this is a connection to.

Public functions

registerReceiver

fun registerReceiver(receiver: SessionConnectionReceiver): Unit

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

suspend fun send(bytes: ByteArray): Result<Unit>

See RemoteConnection.send

sendFuture

fun sendFuture(bytes: ByteArray): ListenableFuture<Void?>

Java-compatible version of send.

unregisterReceiver

fun unregisterReceiver(receiver: SessionConnectionReceiver): Unit

Unregisters a given receiver from the remote device.

Public properties

participant

val participantSessionParticipant

The participant this this is a connection to.