本文整理汇总了C++中Acceptor::get_pending_count方法的典型用法代码示例。如果您正苦于以下问题:C++ Acceptor::get_pending_count方法的具体用法?C++ Acceptor::get_pending_count怎么用?C++ Acceptor::get_pending_count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Acceptor
的用法示例。
在下文中一共展示了Acceptor::get_pending_count方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: r_manager
//.........这里部分代码省略.........
ACE_Time_Value time_end = ACE_OS::gettimeofday ();
ACE_Time_Value time_run;
ACE_Time_Value timeout (cfg.timeout(), 0);
r_manager.set_timeout (timeout);
s_manager.set_timeout (timeout);
time_begin = ACE_OS::gettimeofday ();
if (cfg.both() != 0 || cfg.connections () == 0) // Acceptor
{
// Simplify, initial read with zero size
if (acceptor.start (ACE_INET_Addr (cfg.listen_port())) == 0)
rc = 1;
}
if (cfg.both() != 0 || cfg.connections () > 0) // Connector
{
ACE_INET_Addr addr;
addr.set (cfg.connect_port(), cfg.connect_host());
rc += connector.start (addr, cfg.connections ());
}
if (rc > 0)
{
//task1.enable_event_loop();
ACE_Time_Value sleep_time (cfg.seconds());
while ( sleep_time != ACE_Time_Value::zero)
{
ACE_Countdown_Time countdown ( & sleep_time );
ACE_OS::sleep (sleep_time );
}
if (cfg.seconds () == 0)
{
bool flgExit = false;
for (;!flgExit;)
{
char c;
cout << "\nEnter:"
<< "\n1 - stop connector"
<< "\n2 - stop acceptor"
<< "\n3 -stop senders"
<< "\n4 -stop receivers"
<< "\nP - statistic"
<< "\nQ quit=>"
<< flush;
cin.clear ();
cin >> c;
switch (toupper (c))
{
case '1':
connector.cancel();
connector.wait ();
break;
case '2':
acceptor.cancel ();
acceptor.wait();
break;
case '3':
s_manager.cancel ();
while (!s_manager.is_safe_to_delete ())
{
task1.wait_signal ();
}
break;
case '4':
r_manager.cancel ();
while (!r_manager.is_safe_to_delete ())
{
task1.wait_signal ();
}
break;
case 'Q':
flgExit = true;
break;
case 'P':
break;
}//switch
cout << "\n*** Connector: PendingConnects="
<< connector.get_pending_count ()
<< " Senders="
<< s_manager.get_number_connections ()
<< "\n*** Acceptor: PendingAccepts="
<< acceptor.get_pending_count ()
<< " Receivers="
<< r_manager.get_number_connections ();
}//for
}//if cfg.seconds