-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #229 from singnet/issue-166-link-creation-client
[#das166] Link Creation client
- Loading branch information
Showing
8 changed files
with
104 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#include <signal.h> | ||
|
||
#include <cstring> | ||
#include <iostream> | ||
#include <string> | ||
|
||
#include "das_link_creation_node.h" | ||
using namespace link_creation_agent; | ||
using namespace std; | ||
|
||
void ctrl_c_handler(int) { | ||
std::cout << "Stopping client..." << std::endl; | ||
std::cout << "Done." << std::endl; | ||
exit(0); | ||
} | ||
|
||
|
||
int main(int argc, char* argv[]) { | ||
string help = R""""( | ||
Usage: link_creation_agent CLIENT_HOST:CLIENT_PORT SERVER_HOST:SERVER_PORT REQUEST+ | ||
Requests must be in the following format: | ||
QUERY, LINK_TEMPLATE, MAX_RESULTS, REPEAT, CONTEXT, UPDATE_ATTENTION_BROKER | ||
MAX_RESULTS and REPEAT are optional, the default value for MAX_RESULTS is 1000 and for REPEAT is 1 | ||
)""""; | ||
|
||
if ((argc < 4)) { | ||
cerr << help << endl; | ||
} | ||
signal(SIGINT, &ctrl_c_handler); | ||
|
||
string client_id = string(argv[1]); | ||
string server_id = string(argv[2]); | ||
|
||
vector<string> request; | ||
for (int i = 3; i < argc; i++) { | ||
request.push_back(argv[i]); | ||
} | ||
|
||
auto client = new LinkCreationNode(client_id, server_id); | ||
client->send_message(request); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters