- in this site http://zeromq.org/distro:microsoft-windows
download Stable Release 2.2.0 win32 version
- install on windows PC
- in visual studio , create win32 console app , for server side ,use code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
#include "C:\\Program Files (x86)\\ZeroMQ 2.2.0\\include\\zmq.hpp" #include <string> #include <iostream> #ifndef _WIN32 #include <unistd.h> #else #include <windows.h> #define sleep(n) Sleep(n) #endif int main () { // Prepare our context and socket zmq::context_t context (1); zmq::socket_t socket (context, ZMQ_REP); socket.bind ("tcp://*:5555"); while (true) { zmq::message_t request; // Wait for next request from client socket.recv (&request); std::cout << "Received Hello" << std::endl; // Do some 'work' sleep(1); // Send reply back to client zmq::message_t reply (5); memcpy (reply.data (), "World", 5); socket.send (reply); } return 0; } |
and for client side , use code :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
// // Hello World client in C++ // Connects REQ socket to tcp://localhost:5555 // Sends "Hello" to server, expects "World" back // #include "C:\\Program Files (x86)\\ZeroMQ 2.2.0\\include\\zmq.hpp" #include <string> #include <iostream> int main () { // Prepare our context and socket zmq::context_t context (1); zmq::socket_t socket (context, ZMQ_REQ); std::cout << "Connecting to hello world server…" << std::endl; socket.connect ("tcp://localhost:5555"); // Do 10 requests, waiting each time for a response for (int request_nbr = 0; request_nbr != 10; request_nbr++) { zmq::message_t request (5); memcpy (request.data (), "Hello", 5); std::cout << "Sending Hello " << request_nbr << "…" << std::endl; socket.send (request); // Get the reply. zmq::message_t reply; socket.recv (&reply); std::cout << "Received World " << request_nbr << std::endl; } return 0; } |
- copy libzmq-v100-mt.lib and libzmq-v100-mt.dll to source.cpp folder
in linker—–>input , add libzmq-v100-mt.lib
- compile and run .
Since Airsoft guns are made to look realistic, carrying one that is visible to others is often a bad
idea (and illegal). Some people have concerns the music
download service won’t support any service when the music download money
does not ensure it is returning to the artist or label.
It was a pursuit that was primarily produced by Inuit women however,
there are already some men doing it as well.