zeromq源码解析
zmq是一款异步的高性能的消息队列中间件,有多种语言版本,目前本人看的是基于C++的4.2.3版本,在研读zmq代码过程中由于大量的异步设计,使得代码的阅读性较低,所以将梳理的代码历程记录于此。
目录:
socekt初始化
connect连接
mailbox
pipe队列,ypipe
session和engine
send发送
msg
recv接收
测试的demo如下:
client:
#include <zmq.h>
#include <string.h>
#include <stdio.h>
using namespace std;
int main()
{
printf("Connecting to hello world server...\n");
void *context = zmq_ctx_new(); //创建上下文
void *requester = zmq_socket