Stay organized with collections
Save and categorize content based on your preferences.
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
Public properties
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# SessionRemoteConnection\n=======================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/com/google/ambient/crossdevice/sessions/SessionRemoteConnection \"View this page in Java\")\n\n\n```\n@RequiresApi(value = 26) interface SessionRemoteConnection\n```\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA connection to a remote device that is participating in a Session. This is a wrapper around [RemoteConnection](/reference/kotlin/com/google/ambient/crossdevice/connections/RemoteConnection) updated to be specific to [SessionParticipant](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionParticipant).\n\nSummary\n-------\n\n| ### Public functions ||\n|-----------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Unit](/reference/kotlin/kotlin/Unit) | [registerReceiver](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionRemoteConnection#registerReceiver(com.google.ambient.crossdevice.sessions.SessionConnectionReceiver))`(receiver: `[SessionConnectionReceiver](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionConnectionReceiver)`)` Registers the given [SessionConnectionReceiver](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionConnectionReceiver) with this channel. |\n| `suspend `[Result](/reference/kotlin/kotlin/Result)`\u003c`[Unit](/reference/kotlin/kotlin/Unit)`\u003e` | [send](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionRemoteConnection#send(kotlin.ByteArray))`(bytes: `[ByteArray](/reference/kotlin/kotlin/ByteArray)`)` See [RemoteConnection.send](/reference/kotlin/com/google/ambient/crossdevice/connections/RemoteConnection#send(kotlin.ByteArray)) |\n| [ListenableFuture](/reference/kotlin/com/google/common/util/concurrent/ListenableFuture)`\u003c`[Void](/reference/kotlin/java/lang/Void)`?\u003e` | [sendFuture](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionRemoteConnection#sendFuture(kotlin.ByteArray))`(bytes: `[ByteArray](/reference/kotlin/kotlin/ByteArray)`)` Java-compatible version of [send](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionRemoteConnection#send(kotlin.ByteArray)). |\n| [Unit](/reference/kotlin/kotlin/Unit) | [unregisterReceiver](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionRemoteConnection#unregisterReceiver(com.google.ambient.crossdevice.sessions.SessionConnectionReceiver))`(receiver: `[SessionConnectionReceiver](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionConnectionReceiver)`)` Unregisters a given receiver from the remote device. |\n\n| ### Public properties ||\n|----------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [SessionParticipant](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionParticipant) | [participant](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionRemoteConnection#participant()) The participant this this is a connection to. |\n\nPublic functions\n----------------\n\n### registerReceiver\n\n```\nfun registerReceiver(receiver: SessionConnectionReceiver): Unit\n```\n\nRegisters the given [SessionConnectionReceiver](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionConnectionReceiver) with this channel. \n\n| Throws ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------|\n| `com.google.ambient.crossdevice.connections.ConnectionsException: `[com.google.ambient.crossdevice.connections.ConnectionsException](/reference/kotlin/com/google/ambient/crossdevice/connections/ConnectionsException) | if the connection is closed. |\n\n### send\n\n```\nsuspend fun send(bytes: ByteArray): Result\u003cUnit\u003e\n```\n\nSee [RemoteConnection.send](/reference/kotlin/com/google/ambient/crossdevice/connections/RemoteConnection#send(kotlin.ByteArray)) \n\n### sendFuture\n\n```\nfun sendFuture(bytes: ByteArray): ListenableFuture\u003cVoid?\u003e\n```\n\nJava-compatible version of [send](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionRemoteConnection#send(kotlin.ByteArray)). \n\n### unregisterReceiver\n\n```\nfun unregisterReceiver(receiver: SessionConnectionReceiver): Unit\n```\n\nUnregisters a given receiver from the remote device.\n\nPublic properties\n-----------------\n\n### participant\n\n```\nval participant: SessionParticipant\n```\n\nThe participant this this is a connection to."]]