2 #include <samchon/protocol/slave/ParallelClient.hpp> 4 #include <samchon/protocol/Invoke.hpp> 15 using namespace library;
16 using namespace protocol;
44 :
public protocol::slave::ParallelClient
47 typedef protocol::slave::ParallelClient super;
59 Slave(
const string &ip,
int port)
65 virtual ~
Slave() =
default;
70 virtual void replyPieceData(shared_ptr<Invoke> invoke,
size_t index,
size_t size)
override 72 if (invoke->getListener() ==
"optimize")
75 invoke->at(0)->getValueAsXML(),
89 virtual void optimize(shared_ptr<XML> xml,
size_t index,
size_t size)
91 cout <<
"----------------------------------------------------------------------------" << endl;
92 cout <<
" OPTIMIZE FROM " << index <<
", SIZE: " << size << endl;
93 cout <<
"----------------------------------------------------------------------------" << endl;
103 sendData( make_shared<Invoke>(
"replyOptimization", xml) );
Slave(const string &ip, int port)
Construct from ip address and port number of master.
virtual void optimize(shared_ptr< XML > xml, size_t index, size_t size)
Optimize something and report the result.
void sendOptimization(shared_ptr< XML > xml)
Send (report) optimization result to its master system.
A slave system for optimizing something.