Server architecture for embedded device

I am working on a server application for the embedded ARM platform. The ARM board connects to various digital IOs, ADCs, etc., which the system will conduct continuously. It currently works with the Linux kernel with hardware interfaces designed as drivers. The idea is to have a client application that can connect to the embedded device and receive touch data as it is updated and issue commands to the device (shutdown sensor 1, restart sensor 2, etc.). Suppose access to touch devices is through a typical ioctl.

Now my question is about the design / architecture of this server application running on the embedded device. At first I thought of using something like libevent or libev , a lightweight C event library. The application will be given the priority value of the sensor polling event (and then send information to the client after the polling is completed) and process the client commands as they are received (via a regular TCP socket ) A server usually has one connection, but can have up to a dozen or so, but not something like thousands of connections. Is this the best approach to developing something like this? Of the two event processing libraries that I have listed, is it best to use embedded applications, or are there other alternatives?

Another approach under consideration is a multi-threaded application in which the interrogation of sensors is performed in a priority / blocking thread that reads sensory data, and each client connection is processed in a separate chain. Sensory data is updated in some kind of buffer / data structure, and connection streams handle sending data to the client and processing client commands (I figured you would need event loops in these streams to monitor incoming commands). Are there any libraries or typical packages that make it easy to develop such an application, or is it something you need to start from scratch?

How would you design what I'm trying to accomplish?

+3
source share
2

unix - , libvent, linux, libevent - . , . .

, , .

, , Google ( ) - ++, () . , . ASN.1 (asn1c).

+3

. . , . (MIPS) boost:: asio .

, , (, , ). , . , , "" "" . . "" , . , .

, , .

+2

Source: https://habr.com/ru/post/1731732/


All Articles