本文整理汇总了C++中address::getB方法的典型用法代码示例。如果您正苦于以下问题:C++ address::getB方法的具体用法?C++ address::getB怎么用?C++ address::getB使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类address
的用法示例。
在下文中一共展示了address::getB方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: connect
void connection::connect(const address & _address)
{
printf("client trying: %d.%d.%d.%d:%d\n",
_address.getA(),
_address.getB(),
_address.getC(),
_address.getD(),
_address.getPort()
);
if(!m_keyPool.empty()) /// If the key pool isn't empty
{
/// access mailList based on the key pools returned value
/// and set mailList element up with the new connections
/// data
m_mailList[m_keyPool.back()].first->m_state = e_connecting;
m_mailList[m_keyPool.back()].first->m_address = _address;
m_mailList[m_keyPool.back()].first->m_timeoutAccumulator = 0.0f;
m_mailList[m_keyPool.back()].first->m_stats.reset();
m_mailList[m_keyPool.back()].second = 0;
/// add the key onto newConKeys and pop it off of the keyPool
/// as it is now in use.
m_newConnKeys.push_back(m_keyPool.back()); ///Receive key
m_keyPool.pop_back();
return;
}
/// If The key pool Is empty
/// allocate a new sender
/// initialise it as a new connection
/// push it back onto mailList
/// then push it's array position onto newConKeys
sender* n_mailer = new sender(m_maxSequence);
n_mailer->m_address = _address;
n_mailer->m_state = e_connecting;
n_mailer->m_timeoutAccumulator = 0.0f;
unsigned short sendKey = 0;
m_mailList.push_back(std::pair<sender*, unsigned short>(n_mailer, sendKey));
m_newConnKeys.push_back(m_mailList.size()-1); /// Receive key
}