Commit a74a9465 authored by legoc's avatar legoc
Browse files

Some renamings

parent 6a18f72b
......@@ -96,19 +96,19 @@ bool PublisherImpl::waitForSubscribers() {
std::unique_ptr<zmq::message_t> reply;
if (type == message::SYNC) {
reply.reset(processInitCommand());
reply.reset(responseToSyncRequest());
}
else if (type == message::SUBSCRIBE_PUBLISHER_v0) {
counter++;
reply.reset(processSubscribePublisherCommand());
reply.reset(responseToSubscribeRequest());
}
else if (type == message::CANCEL) {
canceled = true;
counter = m_numberOfSubscribers;
reply.reset(processCancelPublisherSyncCommand());
reply.reset(responseToCancelRequest());
}
else {
reply.reset(processUnknownCommand());
reply.reset(responseToUnknownRequest());
}
// send to the client
......@@ -218,7 +218,7 @@ void PublisherImpl::publishTwoParts(const std::string& header, const char* data1
m_publisher->send(requestData2);
}
zmq::message_t * PublisherImpl::processInitCommand() {
zmq::message_t * PublisherImpl::responseToSyncRequest() {
// send a dummy SYNC message by the publisher socket
std::string data(message::Event::SYNC);
......@@ -233,7 +233,7 @@ zmq::message_t * PublisherImpl::processInitCommand() {
return reply;
}
zmq::message_t * PublisherImpl::processSubscribePublisherCommand() {
zmq::message_t * PublisherImpl::responseToSubscribeRequest() {
std::string result = createRequestResponse(0, "OK");
......@@ -243,7 +243,7 @@ zmq::message_t * PublisherImpl::processSubscribePublisherCommand() {
return reply;
}
zmq::message_t * PublisherImpl::processCancelPublisherSyncCommand() {
zmq::message_t * PublisherImpl::responseToCancelRequest() {
std::string result = createRequestResponse(0, "OK");
......@@ -253,7 +253,7 @@ zmq::message_t * PublisherImpl::processCancelPublisherSyncCommand() {
return reply;
}
zmq::message_t * PublisherImpl::processUnknownCommand() {
zmq::message_t * PublisherImpl::responseToUnknownRequest() {
std::string result = createRequestResponse(-1, "Unknown command");
......
......@@ -56,10 +56,10 @@ public:
void publish(const std::string& header, const char* data, std::size_t size);
void publishTwoParts(const std::string& header, const char* data1, std::size_t size1, const char* data2, std::size_t size2);
zmq::message_t * processInitCommand();
zmq::message_t * processSubscribePublisherCommand();
zmq::message_t * processCancelPublisherSyncCommand();
zmq::message_t * processUnknownCommand();
zmq::message_t * responseToSyncRequest();
zmq::message_t * responseToSubscribeRequest();
zmq::message_t * responseToCancelRequest();
zmq::message_t * responseToUnknownRequest();
std::string createTerminatePublisherRequest(int id, const std::string& name) const;
......
......@@ -105,14 +105,14 @@ std::unique_ptr<RequestImpl> ResponderImpl::receive() {
m_responder->recv(message.get(), 0);
result->m_message2 = std::string(message->data<char>(), message->size());
}
reply.reset(processRequest());
reply.reset(responseToRequest());
}
else if (type == message::CANCEL) {
m_canceled = true;
reply.reset(processCancelResponder());
reply.reset(responseToCancelResponder());
}
else {
reply.reset(processUnknownRequest());
reply.reset(responseToUnknownRequest());
}
// send to the client
......@@ -123,7 +123,7 @@ std::unique_ptr<RequestImpl> ResponderImpl::receive() {
return result;
}
zmq::message_t * ResponderImpl::processRequest() {
zmq::message_t * ResponderImpl::responseToRequest() {
std::string result = createRequestResponse(0, "OK");
......@@ -133,7 +133,7 @@ zmq::message_t * ResponderImpl::processRequest() {
return reply;
}
zmq::message_t * ResponderImpl::processCancelResponder() {
zmq::message_t * ResponderImpl::responseToCancelResponder() {
std::string result = createRequestResponse(0, "OK");
......@@ -143,7 +143,7 @@ zmq::message_t * ResponderImpl::processCancelResponder() {
return reply;
}
zmq::message_t * ResponderImpl::processUnknownRequest() {
zmq::message_t * ResponderImpl::responseToUnknownRequest() {
std::string result = createRequestResponse(-1, "Unknown request");
......
......@@ -40,9 +40,9 @@ public:
std::unique_ptr<RequestImpl> receive();
zmq::message_t * processRequest();
zmq::message_t * processCancelResponder();
zmq::message_t * processUnknownRequest();
zmq::message_t * responseToRequest();
zmq::message_t * responseToCancelResponder();
zmq::message_t * responseToUnknownRequest();
void terminate();
......
......@@ -91,19 +91,19 @@ public class PublisherImpl {
long type = JSON.getLong(request, Messages.TYPE);
if (type == Messages.SYNC) {
reply = processSyncRequest();
reply = responseToSyncRequest();
}
else if (type == Messages.SUBSCRIBE_PUBLISHER_v0) {
counter++;
reply = processSubscribePublisherRequest();
reply = responseToSubscribeRequest();
}
else if (type == Messages.CANCEL) {
canceled = true;
counter = numberOfSubscribers;
reply = processCancelPublisherRequest();
reply = responseToCancelRequest();
}
else {
reply = processUnknownRequest();
reply = responseToUnknownRequest();
}
// send to the client
......@@ -199,7 +199,7 @@ public class PublisherImpl {
}
}
private Zmq.Msg processSyncRequest() {
private Zmq.Msg responseToSyncRequest() {
// send a dummy SYNC message by the publisher socket
publisher.sendMore(Messages.Event.SYNC);
......@@ -211,7 +211,7 @@ public class PublisherImpl {
return message;
}
private Zmq.Msg processSubscribePublisherRequest() {
private Zmq.Msg responseToSubscribeRequest() {
Zmq.Msg message = new Zmq.Msg();
message.add(Messages.serialize(Messages.createRequestResponse(0, "OK")));
......@@ -219,7 +219,7 @@ public class PublisherImpl {
return message;
}
private Zmq.Msg processCancelPublisherRequest() {
private Zmq.Msg responseToCancelRequest() {
Zmq.Msg message = new Zmq.Msg();
message.add(Messages.serialize(Messages.createRequestResponse(0, "OK")));
......@@ -227,7 +227,7 @@ public class PublisherImpl {
return message;
}
private Zmq.Msg processUnknownRequest() {
private Zmq.Msg responseToUnknownRequest() {
Zmq.Msg message = new Zmq.Msg();
message.add(Messages.serialize(Messages.createRequestResponse(-1, "Unknown request")));
......
......@@ -156,7 +156,7 @@ public class RequesterImpl {
}
// Send to the responder
Zmq.Msg reply = processReplyRequest();
Zmq.Msg reply = responseToRequest();
reply.send(requester);
}
}
......@@ -201,7 +201,7 @@ public class RequesterImpl {
}
}
private Zmq.Msg processReplyRequest() {
private Zmq.Msg responseToRequest() {
Zmq.Msg message = new Zmq.Msg();
message.add(Messages.serialize(Messages.createRequestResponse(0, "OK")));
......
......@@ -117,7 +117,7 @@ public class ResponderImpl {
}
// Send to the requester
reply = processReplyRequest();
reply = responseToRequest();
reply.send(responder);
if (reply != null) {
......@@ -142,7 +142,7 @@ public class ResponderImpl {
requestSocket.terminate();
}
private Zmq.Msg processReplyRequest() {
private Zmq.Msg responseToRequest() {
Zmq.Msg message = new Zmq.Msg();
message.add(Messages.serialize(Messages.createRequestResponse(0, "OK")));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment