1515 */
1616
1717#include < cstddef> // std::size_t
18+ #include < cstdlib> // std::exit
1819#include < utility> // std::move
1920#include < thread>
2021#include < future>
3940#include " test_data_blaster/dsr_args.hpp"
4041#include " test_data_blaster/monitor_msg_handling.hpp"
4142
42- const std::string_view msg_prefix { " Tasty testing !" };
43+ const std::string_view msg_prefix { " Tasty!" };
4344
4445void send_mon_msg (chops::test::monitor_connector& mon,
4546 chops::test::monitor_msg_data& mon_msg,
@@ -58,15 +59,14 @@ void send_mon_msg (chops::test::monitor_connector& mon,
5859 mon_msg.m_outgoing_queue_size = oqs ? (*oqs).output_queue_size : 0u ;
5960// mon.send_monitor_msg(mon_msg);
6061// temporary display until monitor functionality is ready
61- std::cerr << " Mon msg : " << mon_msg.m_dsr_name << " , " <<
62+ std::cerr << " Mon: " << mon_msg.m_dsr_name << " , " <<
6263 mon_msg.m_protocol << " , " <<
6364 mon_msg.m_remote_addr << " , " <<
6465 (mon_msg.m_direction == chops::test::monitor_msg_data::incoming ? " incoming, " : " outgoing, " ) <<
6566 mon_msg.m_curr_msg_num << " /" << mon_msg.m_total_msgs_to_send << " , " <<
66- mon_msg.m_curr_msg_size << " , " <<
67- mon_msg.m_curr_msg_beginning << " , " <<
68- mon_msg.m_outgoing_queue_size << std::endl;
69-
67+ mon_msg.m_curr_msg_size << " , q sz: " <<
68+ mon_msg.m_outgoing_queue_size << " , " <<
69+ mon_msg.m_curr_msg_beginning << std::endl;
7070 }
7171}
7272
@@ -181,6 +181,29 @@ void start_entity (chops::net::net_entity ent, char body_char,
181181// 8 - host, if connector
182182auto temp_parse_cmd (int argc, char * argv[]) {
183183
184+ if (argc < 8 ) {
185+ std::cerr << " Parameters (temporary):" << ' \n ' <<
186+ " name R/n mod cnt delay A/C port (host)" << ' \n ' <<
187+ " where:" << ' \n ' <<
188+ " name = DSR name" << ' \n ' <<
189+ " R = reply (anything else means no reply)" << ' \n ' <<
190+ " mod = display modulo number" << ' \n ' <<
191+ " cnt = send count (0 for receive only)" << ' \n ' <<
192+ " delay = delay in milliseconds between sends (ignored if send count is 0)" << ' \n ' <<
193+ " A/C = A for acceptor, C for connector" << ' \n ' <<
194+ " port = port number (for either acceptor or connector)" << ' \n ' <<
195+ " host = if connector, host name or IP number" << ' \n ' << std::endl;
196+ std::exit (0 );
197+ }
198+ // 1 - dsr name
199+ // 2 - R for reply
200+ // 3 - mod
201+ // 4 - send count
202+ // 5 - delay
203+ // 6 - A for acceptor, C for connector
204+ // 7 - port
205+ // 8 - host, if connector
206+
184207 chops::test::tcp_dsr_args parms;
185208 parms.m_dsr_name = std::string (argv[1 ]);
186209 parms.m_reply = (*(argv[2 ]) == ' R' );
@@ -234,6 +257,9 @@ int main (int argc, char* argv[]) {
234257 start_entity (ent, body_char++, parms, send_futs, mon, mon_msg, err_wq);
235258 }
236259
260+ // temporary - wait a while, then cause future to pop
261+ std::this_thread::sleep_for (std::chrono::minutes (1 ));
262+ mon.shutdown ();
237263 // everything up and running, block waiting on shutdown msg
238264 shutdown_fut.get (); // monitor sent shutdown msg
239265 nip.stop_all (); // stop all entities
0 commit comments