Chapter 2. Sockets and Patterns
In Chapter 1 we took ÃMQ for a drive, with some basic examples of the main ÃMQ patterns: request-reply, publish-subscribe, and pipeline. In this chapter, weâre going to get our hands dirty and start to learn how to use these tools in real programs.
Weâll cover:
How to create and work with ÃMQ sockets
How to send and receive messages on sockets
How to build your apps around ÃMQâs asynchronous I/O model
How to handle multiple sockets in one thread
How to handle fatal and nonfatal errors properly
How to handle interrupt signals like Ctrl-C
How to shut down a ÃMQ application cleanly
How to check a ÃMQ application for memory leaks
How to send and receive multipart messages
How to forward messages across networks
How to build a simple message queuing broker
How to write multithreaded applications with ÃMQ
How to use ÃMQ to signal between threads
How to use ÃMQ to coordinate a network of nodes
How to create and use message envelopes for publish-subscribe
How to use the high-water mark (HWM) to protect against memory overflows
Get ZeroMQ now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.