本文整理汇总了C++中cosnotifychanneladmin::EventChannel_var::set_admin方法的典型用法代码示例。如果您正苦于以下问题:C++ EventChannel_var::set_admin方法的具体用法?C++ EventChannel_var::set_admin怎么用?C++ EventChannel_var::set_admin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cosnotifychanneladmin::EventChannel_var
的用法示例。
在下文中一共展示了EventChannel_var::set_admin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ACE_TMAIN
int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
int status = 0;
try
{
Consumer_Client client;
status = client.init (argc, argv);
if (status != 0)
{
ACE_ERROR_RETURN ((LM_ERROR,
"Error: Client init failed.\n"),
1);
}
CosNotifyChannelAdmin::EventChannel_var ec =
client.create_event_channel ("MyEventChannel", 0);
#ifdef TEST_QOS_MAX_QUEUE_LENGTH
ACE_OS::printf ("%s: setting max queue length to 1000\n", argv[0]);
CosNotification::AdminProperties properties(1);
properties.length(1);
properties[0].name = CORBA::string_dup (CosNotification::MaxQueueLength);
properties[0].value <<= 1000;
ec->set_admin(properties);
#endif //TEST_QOS_MAX_QUEUE_LENGTH
CORBA::ORB_ptr orb = client.orb ();
CORBA::Object_var object =
orb->string_to_object (ior);
MonitorTestInterface_var sig =
MonitorTestInterface::_narrow (object.in ());
if (CORBA::is_nil (sig.in ()))
{
ACE_ERROR_RETURN ((LM_ERROR,
"Error: Narrow failed.\n"),
1);
}
CosNotifyChannelAdmin::ConsumerAdmin_var admin =
create_consumeradmin (ec.in ());
if (CORBA::is_nil (admin.in ()))
{
ACE_ERROR_RETURN ((LM_ERROR,
"Error: nil ConsumerAdmin.\n"),
1);
}
create_consumers (admin.in (), &client);
sig->running (MonitorTestInterface::Consumer);
ACE_DEBUG ((LM_DEBUG, "\nConsumer waiting for events...\n"));
FILE* ready_file = ACE_OS::fopen (ACE_TEXT_ALWAYS_CHAR(ready_output_file), "w");
if (ready_file == 0)
{
ACE_ERROR_RETURN ((LM_ERROR,
"Cannot open ready file for writing\n"),
1);
}
ACE_OS::fprintf (ready_file, "ready\n");
ACE_OS::fclose (ready_file);
client.ORB_run ();
#ifdef PAUSE_ON_EXIT
_cputs( "All events received. Still connected.\n");
_cputs( "Hit a key to exit consumer: " );
_getch();
#endif // PAUSE_ON_EXIT
ACE_DEBUG ((LM_DEBUG, "Consumer done.\n"));
consumer_1->disconnect ();
ec->destroy ();
sig->finished (MonitorTestInterface::Consumer);
}
catch (const CORBA::Exception& e)
{
e._tao_print_exception ("Consumer Error: ");
status = 1;
}
return status;
}