4.2. HTTP Server Module¶
4.2.1. References¶
4.2.2. Concept: M2M and Messaging Patterns¶
- M2M: machine-to-machine communication
- Machine can be anything: sensors, lights, refrigerators, cars, manufacturing robots, irrigation systems, …
- Need for an infrastructure that connects components and services, ideally in a loosely coupled manner in order to maximize scalability
- Messaging pattern: a network-oriented architectural pattern which describes how two different parts of a message passing system communicate with each other
- For example: HTTP GET, … TODO
- To implement a messaging pattern and perform machine-to-machine communication, an application protocol is used
- The application protocol is usually implemented in user space on top of an in kernel transport mechanism (TCP, UDP, Unix Domain Socket, serial line, wireless link, …)
- Application protocol definition and encapsulation (example UDP):
4.2.3. Concept: Request/reply messaging pattern¶
- Aka REQREP, Request/response
- Messaging pattern that allows …
- Form of asynchronous client-to-service or service-to-service communication that enables event-driven architectures
- Allows decoupling of applications into smaller, independent building blocks
- This increases performance, reliability and scalability
- In most cases, a client needs a separate connection needs to be established to every publisher
- … TODO
4.2.4. Assignment¶
- Create a HTTP server module
- Use raw POSIX sockets
- Use an open source HTTP parser
- Create a header file for reuse in other programs
4.2.5. Module API¶
TODO
4.2.6. Hints¶
- Use an event loop (or poll mechanism) for handling the socket file descriptors
4.2.7. Questions¶
- What are the most popular REQREP (or messaging in general) protocols?