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 |
registerReceiver(receiver: SessionConnectionReceiver)Registers the given |
suspend Result<Unit> |
|
ListenableFuture<Void?> |
sendFuture(bytes: ByteArray)Java-compatible version of |
Unit |
unregisterReceiver(receiver: SessionConnectionReceiver)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. |
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.