mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-18 03:26:15 +02:00
added stuff
git-svn-id: svn://elaine/murooma/trunk@119 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
parent
1e28b4a2fc
commit
d43298f0fe
4 changed files with 406 additions and 0 deletions
36
rtrServer.cpp
Normal file
36
rtrServer.cpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
//
|
||||
// Custom routing Router to Mama (ROUTER to REQ)
|
||||
//
|
||||
// Olivier Chamoux <olivier.chamoux@fr.thalesgroup.com>
|
||||
|
||||
#include "zhelpers.hpp"
|
||||
|
||||
#define NBR_WORKERS 10
|
||||
|
||||
|
||||
int main () {
|
||||
zmq::context_t context(2);
|
||||
zmq::socket_t client (context, ZMQ_ROUTER);
|
||||
client.bind("tcp://127.0.0.1:10000");
|
||||
|
||||
int task_nbr;
|
||||
while (true)
|
||||
{
|
||||
// LRU worker is next waiting in queue
|
||||
std::string address = s_recv (client);
|
||||
std::cout << "Address: " << address << "\n";
|
||||
|
||||
// receiving and discarding'empty' message
|
||||
s_recv (client);
|
||||
// receiving and discarding 'ready' message
|
||||
std::string msg = s_recv (client);
|
||||
std::cout << "msg: " << msg << "\n";
|
||||
|
||||
s_sendmore (client, address);
|
||||
s_sendmore (client, "");
|
||||
s_send (client, std::string("hello: ") + address);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue