Exemplo n.º 1
0
int incexc_send_client(struct config *conf, struct cntr *p1cntr)
{
	if(do_start("incexc", "incexc ok")
	  || do_sends(conf)
	  || do_finish("incexc end", "incexc end ok"))
		return -1;
	return 0;
}
Exemplo n.º 2
0
int incexc_send_server(struct config *conf, struct cntr *p1cntr)
{
	/* 'sincexc' and 'sincexc ok' have already been exchanged,
	   so go straight into doing the sends. */
	if(do_sends(conf)
	  || do_finish("sincexc end", "sincexc end ok"))
		return -1;
	return 0;
}
Exemplo n.º 3
0
void connection_handler::handle_messages()
{
    detail::handling_messages hm(handling_messages_);       // reset on exit

    bool bootstrapping = hpx::is_starting();
    bool has_work = true;
    std::size_t k = 0;

    hpx::util::high_resolution_timer t;
    // We let the message handling loop spin for another 2 seconds to avoid the
    // costs involved with posting it to asio
    while(bootstrapping || (!stopped_ && has_work) || (!has_work && t.elapsed() < 2.0))
    {
        // handle all sends ...
        has_work = do_sends();
        // handle all receives ...
        if(do_receives())
        {
            has_work = true;
        }

        if (bootstrapping)
            bootstrapping = hpx::is_starting();

        if(has_work)
        {
            t.restart();
            k = 0;
        }
        else
        {
            if(enable_parcel_handling_)
            {
                hpx::lcos::local::spinlock::yield(k);
                ++k;
            }
        }
    }
}