GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Write loads of logging · hmenke/cpp-patterns@2745e34

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • python_zmq_communication
    • server.cpp
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎python_zmq_communication/server.cpp‎

Copy file name to clipboardExpand all lines: python_zmq_communication/server.cpp
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,26 @@
77

88
void perform(int nseconds, std::string const& endpoint)
99
{
10+
std::cout << "Welcome to perform()" << std::endl;
1011
// Prepare our context and socket
12+
std::cout << "Create context" << std::endl;
1113
zmq::context context;
14+
std::cout << "Create socket" << std::endl;
1215
zmq::socket publisher = context.socket(ZMQ_PUB);
16+
std::cout << "Connect socket to endpoint" << std::endl;
1317
publisher.connect(endpoint.c_str());
1418

19+
std::cout << "Enter the waiting loop" << std::endl;
1520
for (int i = 0; i < 5; ++i)
1621
{
22+
std::cout << "Waiting for " << nseconds << " s" << std::endl;
1723
std::this_thread::sleep_for(std::chrono::seconds{nseconds});
1824

25+
std::cout << "Sending loop index" << std::endl;
1926
publisher.send("%1d", i);
2027
}
2128

29+
std::cout << "Sending end signal" << std::endl;
2230
publisher.send(">>END" );
31+
std::cout << "Bye... :-)" << std::endl;
2332
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.