History

TimeSeriesPlatformLibrary: Added InstancePublish sample to show how to create multiple GEP data publisher instances.

J. Ritchie Carroll committed 7 years ago

Commit a980d721 parent dcb6ae511 files · +549 −2Browse files

Showing the changes to Source/Libraries/TimeSeriesPlatformLibrary/Samples/InstanceSubscribe.cpp (1 of 11 files). Show all

Unified · Split

Source/Libraries/TimeSeriesPlatformLibrary/Samples/InstanceSubscribe.cpp+5−1
@@ -37,6 +37,7 @@ int main(int argc, char* argv[]) · 36 unmodified lines
3737 {
3838 string hostname;
3939 uint16_t port;
40+ bool usePortOffset = false;
4041
4142 // Ensure that the necessary
4243 // command line arguments are given.
@@ -51,12 +52,15 @@ int main(int argc, char* argv[]) · 8 unmodified lines
5152 hostname = argv[1];
5253 stringstream(argv[2]) >> port;
5354
55+ if (argc > 3)
56+ usePortOffset = ParseBoolean(argv[3]);
57+
5458 // Initialize the subscribers.
5559 for (uint32_t i = 0; i < TotalInstances; i++)
5660 {
5761 // Maintain the life-time of SubscriberHandler instances within main
5862 SubscriberHandler* subscriber = new SubscriberHandler("Subscriber " + ToString(i + 1));
59− subscriber->Initialize(hostname, port);
63+ subscriber->Initialize(hostname, port + static_cast<uint16_t>(usePortOffset ? i : 0));
6064
6165 switch (i)
6266 {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t