Client
KrpcClient
KrpcClient is an abstract class that implements RpcClient and kRPC protocol logic.
Initialization
The client comes in two forms:
KrpcClientInitializedKrpcClient
The only difference between them is that KrpcClient allows to delay the initialization of the transport until the first RPC request is sent. InitializedKrpcClient is initialized right away with a ready KrpcTransport instance.
Transport
The only thing required to be implemented is the transporting of the raw data. Abstract transport is represented by KrpcTransport interface.
To implement your own KrpcTransport you need to be able to transfer strings and/or raw bytes (Kotlin's ByteArray). Additionally, the library will provide you with integrations with different libraries that are used to work with the network.
See below an example usage of kRPC with a custom transport: