src/ZeroMQCommand.cpp
branchv_0
changeset 2 f724d805c34a
parent 1 27c11cea34de
child 3 3891db9e45b7
equal deleted inserted replaced
1:27c11cea34de 2:f724d805c34a
    47 void ZeroMQCommand::process(std::shared_ptr<writer::RelationalWriter> writer, Configuration& configuration) {
    47 void ZeroMQCommand::process(std::shared_ptr<writer::RelationalWriter> writer, Configuration& configuration) {
    48 	zmq::context_t zmqContext;
    48 	zmq::context_t zmqContext;
    49 	zmq::socket_t zmqSocket(zmqContext, zmq::socket_type::pull);
    49 	zmq::socket_t zmqSocket(zmqContext, zmq::socket_type::pull);
    50 	zmqSocket.bind(convertor.to_bytes(configuration.endpointUrl));
    50 	zmqSocket.bind(convertor.to_bytes(configuration.endpointUrl));
    51 
    51 
       
    52 
       
    53 	if (false) {
       
    54 		// TODO: optionally generate and print keys and/or do encryption
       
    55 		char server_public_key[41];
       
    56 		char server_secret_key[41];
       
    57 		zmq_curve_keypair(server_public_key, server_secret_key);
       
    58 		std::cerr << "Server public key: " << std::string(server_public_key) << std::endl;
       
    59 		std::cerr << "Server secret key: " << std::string(server_secret_key) << std::endl;
       
    60 	}
       
    61 
    52 	writer->startRelation(configuration.relation,{
    62 	writer->startRelation(configuration.relation,{
    53 		{L"text", TypeId::STRING},
    63 		{L"text", TypeId::STRING},
    54 		{L"data", TypeId::STRING}
    64 		{L"data", TypeId::STRING}
    55 	}, true);
    65 	}, true);
    56 
    66