本文整理汇总了C++中Acceptor::GetBacklog方法的典型用法代码示例。如果您正苦于以下问题:C++ Acceptor::GetBacklog方法的具体用法?C++ Acceptor::GetBacklog怎么用?C++ Acceptor::GetBacklog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Acceptor
的用法示例。
在下文中一共展示了Acceptor::GetBacklog方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitReactor
bool LeaderFollowerPool::InitReactor(ROAnything args) {
StartTrace(LeaderFollowerPool.InitReactor);
TraceAny(args, "Init arguments:");
long argSz = args.GetSize();
if (argSz <= 0) {
Trace("argSz:[" << argSz << "]");
SYSERROR("no acceptors: argument <= 0");
return false;
}
if (!fReactor) {
Trace("Reactor not set");
SYSERROR("Reactor not set");
return false;
}
for (long i = 0; i < argSz; ++i) {
Acceptor *acceptor = (Acceptor *) args[i].AsIFAObject(0);
if (acceptor) {
int retVal;
if ((retVal = acceptor->PrepareAcceptLoop()) != 0) {
String logMsg;
logMsg << "server (" << args.SlotName(i) << ") prepare accept failed with retVal " << (long) retVal;
SYSERROR(logMsg);
Trace(logMsg);
return false;
}
// start the accept loop
OStringStream os;
os << std::setw(20) << args.SlotName(i) << " Accepting requests from: " << acceptor->GetAddress() << " port: "
<< acceptor->GetPort() << " backlog: " << acceptor->GetBacklog() << std::endl;
SystemLog::WriteToStderr(os.str());
fReactor->RegisterHandle(acceptor);
} else {
return false;
}
}
return true;
}