概述
//Request-reply client in C++
//Connects REQ socket to tcp://localhost:5559
//Sends "Hello" to server, expects "World" back
//
// Olivier Chamoux <olivier.chamoux@fr.thalesgroup.com>
#include "zhelpers.hpp"
int main (int argc,char *argv[])
{
zmq::context_t context(1);
zmq::socket_t requester(context, ZMQ_REQ);
requester.connect("tcp://localhost:5559");
for(int request =0 ; request <10 ; request++) {
s_send (requester, "Hello");
std::string string= s_recv (requester);
std::cout<< "Received reply " << request<<" ["<< string<< "]" << std::endl;
}
return 0;
}
最后
以上就是典雅服饰为你收集整理的继
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复