本文整理汇总了C++中ACE_Token_Proxy::client_id方法的典型用法代码示例。如果您正苦于以下问题:C++ ACE_Token_Proxy::client_id方法的具体用法?C++ ACE_Token_Proxy::client_id怎么用?C++ ACE_Token_Proxy::client_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ACE_Token_Proxy
的用法示例。
在下文中一共展示了ACE_Token_Proxy::client_id方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
ACE_Token_Proxy *
ACE_Token_Handler::get_proxy (void)
{
ACE_TRACE ("ACE_Token_Handler::get_proxy");
// See if the proxy already exists in the collection.
ACE_Token_Proxy *proxy = collection_.is_member (token_request_.token_name ());
// If not, create one.
if (proxy == 0)
{
proxy = this->create_proxy ();
// Put the new_proxy in this client_id's collection.
if (collection_.insert (*proxy) == -1)
ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("insert failed\n")), 0);
// Delete our copy (one was created in the collection).
delete proxy;
proxy = collection_.is_member (token_request_.token_name ());
if (proxy == 0)
ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("is_member failed\n")), 0);
// Set the client_id (it was set to 1 since we're
// single-threaded.
proxy->client_id (token_request_.client_id ());
}
return proxy;
}
示例2: tid
ACE_Token_Proxy *
STDIN_Token::get_proxy (const char *_tid, const char *token, char type)
{
ACE_Token_Collection *proxy_collection;
TID tid (_tid);
if (collections_.find (tid, proxy_collection) == -1)
// We did not find a proxy_collection.
{
// Make one.
proxy_collection = new ACE_Token_Collection (debug_, "no name collection");
// Put it in the collections.
if (collections_.bind (tid, proxy_collection) == -1)
{
delete proxy_collection;
return 0;
}
}
// Either way, we have a proxy_collection now.
// See if the proxy already exists in the collection.
ACE_Token_Proxy *proxy = proxy_collection->is_member (token);
// If not, create one.
if (proxy == 0)
{
proxy = this->create_proxy (token, type);
// Put the new_proxy in this tid's collection.
if (proxy_collection->insert (*proxy) == -1)
ACE_ERROR_RETURN ((LM_ERROR, "insert failed\n"), 0);
// Delete our copy (one was created in the collection).
delete proxy;
proxy = proxy_collection->is_member (token);
if (proxy == 0)
ACE_ERROR_RETURN ((LM_ERROR, "is_member failed\n"), 0);
// Set the client_id (it was set to 1 since we're
// single-threaded.
proxy->client_id (_tid);
}
return proxy;
}