Kaa code flow - server to endpoint - kaa

I tried debugging the kaa source code and I needed help to understand the correct flow.
My understanding:
As soon as endpoint application starts it sends KAAConnect message to the server and then server does endpoint profiling and registration.
My question:
if we send configuration, how it reaches to the endpoint, What I observe endpoint also sends KAASYNC message to the server.
Is it some kind of polling it is doing?
atleast the basic flow how server interacts with endpoint in case of notification or configuration?
Please clarify my doubts!

To configure an endpoint, the Kaa Configuration subsystem sends structured data from Kaa server to that endpoint. See Configuration management
documentation for details. For details about notification feature look at the
Notifications documentation page.

Related

How do I implement a gRPC IPC?

There is a server application (ASP.NET Core (gRPC service)) and a client application running on another PC (WPF).
One of the functions of the gRPC service is to send screenshots to the client application, but it has to be run as a Windows service, so I can't get screenshots directly from the service to the client application.
Question: how to implement an "agent" application running on a remote computer where the service is, but in a user session to get screenshots through it and then pass them to the client?
As I understand it is possible to do it with the help of IPC, but I can't understand the details of implementation, how can I call from gRPC service to the agent to make a screenshot, return the result (as an array of bytes) to the service and it sends it to the client...

Kaa has heart-rate mechanism for all endpoints?? Will Kaa kick off one endpoint automatically?

An endpoint connect to the Kaa server and subscribe some topics.
In normal condition, KaaClient's unsubscribeFromTopic() & stop() method will be called before disconnect the Kaa server.
In some cases, the endpoint maybe disconnect the Kaa server suddenly and won't re-connect to Kaa server immediately (ex: loss power...).
If an endpoint disconnect the Kaa server without call the unsubscribeFromTopic() & stop() method, the resource will still be occupied??
If yes, the Kaa server has heart-rate mechanism for all endpoints??
Will Kaa server kick off one endpoint automatically if it can detect the endpoint has disconnected exceed over a period time??
Short answer is yes, Kaa will free resources once no active connections are present. There is a ping-pong mechanism to track session inactivity. Inactivity timeout that will be used is configurable. See this configuration file for more details.
Extended answer: Kaa uses actor system based on Akka framework to handle endpoint requests/sessions. Each Endpoint has associated Endpoint Actor (actually, there are at least two of them, one on the node that handles endpoint session and one global actor for particular endpoint in the Kaa cluster). This actors schedule timeouts once no active sessions is available.

How to use a client websocket to connect to a remote websocket windows server

Help needed please
What's is the best WebSocket client library for a .net 4.5 on windows web application hosted on windows 2008 servers to connect to a remote server web socket.
The scenario is: our web application will use a web socket to connect to a server WebSocket on a third party infrastructure. Our client WebSocket will connect and send some commands and read the responses where we can identify the information needed. So there is no interaction from the user or browser its just in the code. e.g. user clicks a button and we go and get some data, and give a message dependant on the response.
so for example our client will connect to the third party socket and pass the users car registration number and send a tell me the car details and the server socket will return the data like: make, model, year etc... so we can then display that to the user.
Has anyone used this library with some good success? http://www.nuget.org/packages/WebSocket4Net
I'm hoping someone here can provide the best approach for doing this with some tried and tested solutions. I have been thinking about a web API that handles all the socket stuff in our client so i can call it and let it handle the close connection etc.

signalr scaleout sending message to only particular client

As I went through the documentaion of signalr scaleout options having a backpane, i see the backpane job is to send the message from one server to all signalr servers. If so, if Server 1 wants to send message to particular client, the message goes to backpane and from there to all other servers(ex. server 2,3)..where the client 1 is connected with Server 1. So can we restrict this to send only from server1 to client 1. Also the other question, are the events like connected, reconnected also will be routed to backpane and to all other servers ?
thanks
If you are using a SignalR backplane, all messages will be sent to all servers. There is no way to configure a SignalR scaleout provider to only send messages to specific servers. It's all or nothing.
If you choose to forgo a backplane, you could of course configure SignalR to use its default in-memory message store and then manually send inter-server messages.
Events like connected/reconnected/disconnected do not involve publishing messages so no messages will be routed to all other servers.

Chat Application in ASP.NET

I've to write an Ajax chat web application in ASP.NET for a friend, and I've a question: if client1 sends a message to client2, how should the application send the message to client2? Is there a better way than sending requests to the server, "asking" if there are new messages? Is it possible to directly send the message to the client?
Best thing you can do is use a Persistent HTTP Connection. The way google does with Google Talk on their GMAIL website.
Remember that HTTP is a stateless protocol and that each transaction is made from the client to the server.
The server can use sessions to determine if this client is "known" but as for sending information back to the client using plain old HTTP I think that is impossible (I mean from a server initiated connection, not a response to the client)
You would need to use Javascript to poll the server for information.
If you want it the other way around, you could possibly use Java or Flash but then you also need to think about NAT tunneling, proxy servers and any other weird setups that the clients could be using.
No. I don't think the server can send message to client's browser.
Here is how I implement chat application:
client1 post message via Ajax to server
server save it to repository (I'm using singleton object for this case)
client2 get the message from repository
mark the message as read
I will save chat logs to database once the chat session closed or expired.

Resources