Exemplo n.º 1
0
void mode_4(pfq::socket &q, int64_t num)
{
    for(int64_t n = 0; n < num;)
    {
        if (q.send_async(pfq::const_buffer(reinterpret_cast<const char *>(ping), sizeof(ping)), 128))
            n++;
    }

    q.wakeup_tx_thread();
}
Exemplo n.º 2
0
void mode_2(pfq::socket &q, int64_t num)
{
    for(int64_t n = 0; n < num;)
    {
        if (q.send_sync(pfq::const_buffer(reinterpret_cast<const char *>(ping), sizeof(ping)), 128))
            n++;
    }

    q.tx_queue_flush();

}
Exemplo n.º 3
0
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++;
    }
}
Exemplo n.º 4
0
void send_packets_async(pfq::socket &q, int64_t num)
{
    std::cout << "sending " << num << " packets (async):" << std::endl;
    for(int64_t n = 0; n < num;)
    {
        if (q.send_async(pfq::const_buffer(reinterpret_cast<const char *>(ping), sizeof(ping)), 1))
            n++;
    }
}