本文整理汇总了C++中EventableDescriptor类的典型用法代码示例。如果您正苦于以下问题:C++ EventableDescriptor类的具体用法?C++ EventableDescriptor怎么用?C++ EventableDescriptor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了EventableDescriptor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: evma_get_outbound_data_size
extern "C" int evma_get_outbound_data_size (const char *binding)
{
if (!EventMachine)
throw std::runtime_error ("not initialized");
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
return ed ? ed->GetOutboundDataSize() : 0;
}
示例2: CloseConnection
void ConnectionDescriptor::CloseConnection (const char *binding, bool after_writing)
{
// TODO: This is something of a hack, or at least it's a static method of the wrong class.
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
if (ed)
ed->ScheduleClose (after_writing);
}
示例3: evma_stop_proxy
extern "C" void evma_stop_proxy (const unsigned long from)
{
ensure_eventmachine("evma_stop_proxy");
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (from));
if (ed)
ed->StopProxy();
}
示例4: evma_start_tls
extern "C" void evma_start_tls (const unsigned long binding)
{
ensure_eventmachine("evma_start_tls");
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
if (ed)
ed->StartTls();
}
示例5: evma_start_proxy
extern "C" void evma_start_proxy (const unsigned long from, const unsigned long to, const unsigned long bufsize)
{
ensure_eventmachine("evma_start_proxy");
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (from));
if (ed)
ed->StartProxy(to, bufsize);
}
示例6: evma_set_tls_parms
extern "C" void evma_set_tls_parms (const unsigned long binding, const char *privatekey_filename, const char *certchain_filename, int verify_peer)
{
ensure_eventmachine("evma_set_tls_parms");
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
if (ed)
ed->SetTlsParms (privatekey_filename, certchain_filename, (verify_peer == 1 ? true : false));
}
示例7: evma_close_connection
extern "C" void evma_close_connection (const unsigned long binding, int after_writing)
{
ensure_eventmachine("evma_close_connection");
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
if (ed)
ed->ScheduleClose (after_writing ? true : false);
}
示例8: evma_is_paused
extern "C" int evma_is_paused (const unsigned long binding)
{
EventableDescriptor *cd = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
if (cd)
return cd->IsPaused() ? 1 : 0;
return 0;
}
示例9: evma_set_tls_parms
extern "C" void evma_set_tls_parms (const char *binding, const char *privatekey_filename, const char *certchain_filename)
{
if (!EventMachine)
throw std::runtime_error ("not initialized");
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
if (ed)
ed->SetTlsParms (privatekey_filename, certchain_filename);
}
示例10: ensure_eventmachine
extern "C" X509 *evma_get_peer_cert (const unsigned long binding)
{
ensure_eventmachine("evma_get_peer_cert");
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
if (ed)
return ed->GetPeerCert();
return NULL;
}
示例11: evma_report_connection_error_status
extern "C" int evma_report_connection_error_status (const unsigned long binding)
{
ensure_eventmachine("evma_report_connection_error_status");
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
if (ed)
return ed->ReportErrorStatus();
return -1;
}
示例12: evma_send_data_to_connection
extern "C" int evma_send_data_to_connection (const unsigned long binding, const char *data, int data_length)
{
ensure_eventmachine("evma_send_data_to_connection");
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
if (ed)
return ed->SendOutboundData(data, data_length);
return -1;
}
示例13: evma_start_tls
extern "C" void evma_start_tls (const char *binding)
{
if (!EventMachine)
throw std::runtime_error ("not initialized");
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
if (ed)
ed->StartTls();
}
示例14: evma_get_last_activity_time
extern "C" uint64_t evma_get_last_activity_time(const unsigned long from)
{
ensure_eventmachine("evma_get_last_activity_time");
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (from));
if (ed)
return ed->GetLastActivity();
else
return 0;
}
示例15: evma_proxied_bytes
extern "C" unsigned long evma_proxied_bytes (const unsigned long from)
{
ensure_eventmachine("evma_proxied_bytes");
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (from));
if (ed)
return ed->GetProxiedBytes();
else
return 0;
}