Перейти к содержанию

Spatium SDK > TransportDriver


interface TransportDriver

Abstract Transport Driver API

Describes anything capable of sending messages and subscribing to incoming messages (e.g. udp socket). Despite some complications due to not tracking message delivery, this is the most simple approach to bidirectional message transfer, which may be implemented via any kind of socket, http+sse etc.


Name Summary
off [androidJvm]
abstract fun off(id: String, data: TransportData?)
Cancel an existing subscription
on [androidJvm]
abstract fun on(filter: TransportFilter, callback: TransportCallback): String
Subscribe to specific kinds of messages
send [androidJvm]
abstract suspend fun send(meta: TransportMeta, data: TransportData)
Send a message via transport