void mode_1(pfq::socket &q, int64_t num) { for(int64_t n = 0; n < num;) { if (q.send(pfq::const_buffer(reinterpret_cast<const char *>(ping), sizeof(ping)))) n++; } }
void send_packets(pfq::socket &q, int64_t num) { std::cout << "sending " << num << " packets:" << std::endl; for(int64_t n = 0; n < num;) { if (q.send(pfq::const_buffer(reinterpret_cast<const char *>(ping), sizeof(ping)))) n++; } }