From af1af342b5c3faf1d5e290c6b623b6287fa8c2b0 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Wed, 13 May 2015 18:07:17 +0200 Subject: remove obsolete stuff --- decoder/feed.cc | 53 ----------------------------------------------------- 1 file changed, 53 deletions(-) delete mode 100644 decoder/feed.cc (limited to 'decoder/feed.cc') diff --git a/decoder/feed.cc b/decoder/feed.cc deleted file mode 100644 index f8923fc4..00000000 --- a/decoder/feed.cc +++ /dev/null @@ -1,53 +0,0 @@ -#include -#include -#include -#include -#include - -#include -#include -#include "nn.hpp" - -using namespace std; - -void -recv(nn::socket& sock) -{ - char *buf = NULL; - size_t sz = sock.recv(&buf, NN_MSG, 0); - if (buf) { - string translation(buf, buf+sz); - cout << "got translation '" << translation << "'" << endl << endl; - } -} - -void -send(nn::socket& sock, const string& msg) -{ - cout << "sending source '" << msg << "'" << endl; - sock.send(msg.c_str(), msg.size()+1, 0); -} - -void -loop(nn::socket& sock) -{ - int to = 100; - sock.setsockopt(NN_SOL_SOCKET, NN_RCVTIMEO, &to, sizeof(to)); - for (string line; getline(cin, line);) { - send(sock, line); - sleep(1); - recv(sock); - } -} - -int main(int argc, char const* argv[]) -{ - nn::socket sock(AF_SP, NN_PAIR); - //string url = "ipc:///tmp/network_decoder.ipc"; - string url = "tcp://127.0.0.1:60666"; - sock.connect(url.c_str()); - loop(sock); - - return 0; -} - -- cgit v1.2.3