21
21
#include < chrono>
22
22
#include < functional> // std::ref, std::cref
23
23
#include < string_view>
24
+ #include < string>
24
25
#include < algorithm> // std::min
25
26
26
27
#include < iostream> // std::cerr for error sink
35
36
#include " shared_test/msg_handling.hpp"
36
37
#include " marshall/shared_buffer.hpp"
37
38
38
- #include " test_data_blaster/tcp_dsr_args .hpp"
39
+ #include " test_data_blaster/dsr_args .hpp"
39
40
#include " test_data_blaster/monitor_msg_handling.hpp"
40
41
41
42
const std::string_view msg_prefix { " Tasty testing!" };
@@ -55,7 +56,17 @@ void send_mon_msg (chops::test::monitor_connector& mon,
55
56
std::min (chops::test::monitor_msg_data::max_msg_data_to_capture, (msg_size - 2u )));
56
57
auto oqs = io_out.get_output_queue_stats ();
57
58
mon_msg.m_outgoing_queue_size = oqs ? (*oqs).output_queue_size : 0u ;
58
- mon.send_monitor_msg (mon_msg);
59
+ // mon.send_monitor_msg(mon_msg);
60
+ // temporary display until monitor functionality is ready
61
+ std::cerr << " Mon msg: " << mon_msg.m_dsr_name << " , " <<
62
+ mon_msg.m_protocol << " , " <<
63
+ mon_msg.m_remote_addr << " , " <<
64
+ (m_direction == chops;:monitor_msg_data::incoming ? " incoming, " : " outgoing, " ) <<
65
+ mon_msg.m_curr_msg_num << " /" << mon_msg.m_total_msgs_to_send " , " <<
66
+ mon_msg.curr_msg_size << " , " <<
67
+ mon_msg.curr_msg_beginning << " , " <<
68
+ mon_msg.m_outgoing_queue_size << std::endl;
69
+
59
70
}
60
71
}
61
72
@@ -159,9 +170,39 @@ void start_entity (chops::net::net_entity ent, char body_char,
159
170
chops::net::make_error_func_with_wait_queue<chops::net::tcp_io>(err_wq));
160
171
}
161
172
173
+ // temporary command line parsing while production version is being developed
174
+ // 1 - dsr name
175
+ // 2 - R means reply is true, anything else not
176
+ // 3 - mod
177
+ // 4 - send count
178
+ // 5 - delay
179
+ // 6 - A means acceptor, C means connector
180
+ // 7 - port
181
+ // 8 - host, if connector
182
+ auto temp_parse_cmd (int argc, char * argv[]) {
183
+
184
+ chops::test::args parms;
185
+ parms.m_dsr_name = std::string (argv[1 ]);
186
+ parms.m_reply = (*(argv[2 ]) == ' R' );
187
+ parms.m_modulus = std::stoi (std::string (argv[3 ]));
188
+ parms.m_send_count = std::stoi (std::string (argv[4 ]));
189
+ parms.m_delay = std::chrono::milliseconds (std::stoi (std::string (argv[5 ])));
190
+ std::string port { argv[7 ] };
191
+ if (argv[6 ] == ' A' ) {
192
+ parms.m_acceptors .push_back (port);
193
+ }
194
+ else {
195
+ std::string host { argv[8 ] };
196
+ parms.m_connectors .push_back (chops::test::connector_info (port, host));
197
+ }
198
+
199
+ return parms;
200
+ }
201
+
162
202
int main (int argc, char * argv[]) {
163
203
164
- auto parms = chops::test::parse_command_line (argc, argv);
204
+ // auto parms = chops::test::parse_command_line(argc, argv);
205
+ auto parms - temp_pars_cmd (argc, argv);
165
206
166
207
char body_char { ' a' };
167
208
@@ -212,5 +253,6 @@ int main (int argc, char* argv[]) {
212
253
std::cerr << " TCP DSR " << parms.m_dsr_name <<
213
254
" , shutting down, num error logs displayed: " << err_cnt << std::endl;
214
255
256
+ return 0 ;
215
257
}
216
258
0 commit comments