NetworkManager

This class is designed to manage connections.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun addConnectionStatusListener(listener: ConnectionStatusListener)

Adds an observer to be notified of connection status changes.

Link copied to clipboard
open override fun addMessageObserver(observer: MessageObserver)

Adds an observer to be notified when a message arrives from DeviceGateway.

Link copied to clipboard
open override fun addOnSendMessageListener(listener: MessageSender.OnSendMessageListener)
Link copied to clipboard
open override fun disable()

Disconnect from DeviceGateway.

Link copied to clipboard
open override fun enable(quiet: Boolean)

Initiate a connection to DeviceGateway.

Link copied to clipboard
open override fun handoffConnection(    protocol: String,     hostname: String,     address: String,     port: Int,     retryCountLimit: Int,     connectionTimeout: Int,     charge: String)

handoff connection from SystemCapability

Link copied to clipboard
open override fun isConnected(): Boolean

Returns whether this object is currently connected to DeviceGateway.

Link copied to clipboard
open override fun isStartReceiveServerInitiatedDirective(): Boolean

Return whether the connection-oriented has been started.

Link copied to clipboard
open override fun newCall(request: MessageRequest, headers: Map<String, String>?): Call
Link copied to clipboard
open override fun onConnectionStatusChanged(status: ConnectionStatusListener.Status, reason: ConnectionStatusListener.ChangedReason)

Receives the connection status changes.

Link copied to clipboard
open override fun receiveAttachment(attachment: AttachmentMessage)
Link copied to clipboard
open override fun receiveDirectives(directives: List<DirectiveMessage>)
Link copied to clipboard
open override fun removeConnectionStatusListener(listener: ConnectionStatusListener)

Removes an observer from being notified of connection status changes.

Link copied to clipboard
open override fun removeMessageObserver(observer: MessageObserver)

Removes an observer to be notified when a message arrives from DeviceGateway.

Link copied to clipboard
open override fun removeOnSendMessageListener(listener: MessageSender.OnSendMessageListener)
Link copied to clipboard
open override fun resetConnection(description: String?)

Resets the connection immediately.

Link copied to clipboard
open override fun shutdown()

Disconnect from DeviceGateway.

Link copied to clipboard
open override fun startReceiveServerInitiatedDirective(onCompletion: () -> Unit?): Boolean

Start the connection-oriented feature.

Link copied to clipboard
open override fun stopReceiveServerInitiatedDirective()

Stop the connection-oriented feature.