Last active
April 29, 2017 03:29
-
-
Save OlegJakushkin/b1e88ae2343bfa0fabe3346429254f9f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <pico.h> | |
#include <zmq_addon.hpp> | |
#include <atomic> | |
#include <thread> | |
using namespace std; | |
atomic<bool> stop; | |
int main() { | |
auto server = []() { | |
while(!stop) { | |
} | |
}; | |
auto client = []() { | |
while(!stop) { | |
} | |
}; | |
thread s(server); | |
thread c(client); | |
while(!stop) { | |
string exit; | |
cin >> exit; | |
if(exit == "exit") { | |
stop = true; | |
} else { | |
cout << "enter 'exit' to quit" << endl; | |
} | |
} | |
s.join(); | |
c.join(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment