작성
·
197
0
const int32 acceptCount = _service->GetMaxSessionCount();
for (int32 i = 0; i < acceptCount; i++)
{
AcceptEvent* acceptEvent = xnew<AcceptEvent>();
acceptEvent->owner = shared_from_this();
_acceptEvents.push_back(acceptEvent);
RegisterAccept(acceptEvent);
}
제가 코드를 제데로 이해했는지 몰라서 질문드립니다
_maxSessionCount가 session의 최대개수를 의미하는 것은 아닌게 맞나요? 저는 _maxSessionCount 가AcceptEvent객체의 개수가 되니까 accept가 병렬적으로 처리될 수 있는 최대 개수로 이해를 했습니다
답변 1
0
_maxSessionCount는 session 최대 개수가 맞긴 한데
그 수치에 비례해서 (ex. 50%라거나) acceptEvent를 걸어주는 경우가 많습니다.
acceptEvent를 딱 1개만 만들어준다거나 하면,
서버 오픈하자마자 사람들이 막 몰릴 때 많은 사람들이 접속을 못하고 튕기게 되겠죠.