Server
Interface which duplicates AIDL Server-side interface
In terms of NEXO Projects:
Server is a listener, which wait for commands from Client to handle and response to Client
Client is initiator which can send commands to Server and handles responses
Communication flow looks like this:
Client[process A] Server[process B]
1. Client ─── connect ──► Server "saves it's reference on side of process A"
2. Server ◄── bind ─── Client "saves it's reference on side of process B"
3. Client ─── calls ──► Server::onMessage
4. Server ─── handles message: String ──► Result ──┐
│
5. [calls ──► Client::onMessage]
│
6. Responses to client◄──┘Reconnection flow has two cases:
1. Connection was not established from first connecting
2. Connection was lost during communicationThere are two types of policy of resolving this issue:
Reset - resets the connection
Reconnect - tries to reconnect to server again with configurable amounts of tries with configured timeouts
Functions
An asynchronous try to bind client
message handler
This method would be called by remote application, once it would require Client's application to become foreground.
Would be called by Client's application in order to ask for restart
An asynchronous try to unbind client