강의

멘토링

커뮤니티

Inflearn Community Q&A

liu's profile image
liu

asked

[MMORPG Game Development with C++ and Unreal Series] Part 4: Game Server

Session #1

CreateSession 질문드립니다

Written on

·

465

0

SessionRef session = _service->CreateSession()
 
SessionRef Service::CreateSession() { SessionRef session = _sessionFactory(); session->SetService(shared_from_this()); if (_iocpCore->Register(session) == false) return nullptr; return session; }
 
iocpcore->Register로 가게되는데
 
AcceptEx 진행전이여서 Socket등록이 되어 있지 않을텐데
 
bool IocpCore::Register(IocpObjectRef iocpObject)
{
return ::CreateIoCompletionPort(iocpObject->GetHandle(), _iocpHandle, /*key*/0, 0);
}
를통해서 IOCP등록이 어떻게 가능한지를 잘모르겠습니다
networkMMORPGwindows-server

Answer 1

0

Rookiss님의 프로필 이미지
Rookiss
Instructor

https://docs.microsoft.com/ko-kr/windows/win32/fileio/createiocompletionport

MSDN 공식 문서의 함수 관련 설명을 읽어보시면 도움이 됩니다.

Liu님의 프로필 이미지
Liu
Questioner

아 acceptEx에 대한 이해가 부족했었습니다

accept랑 동일하게 등록이 성공후 클라이언트에 대한 소켓을 반환하는 것 인줄 알았는데

acceptex는 미리 소켓에 대한 정보를 넘겨서 연결 성공 후 소켓에 등록하는 방식이어서 상관없음을 알게되었습니다 

감사합니다.

liu's profile image
liu

asked

Ask a question