|
JNetLibray
|
클라이언트 세션을 그룹 단위로 묶고, 'JNetGroupThread' 인스턴스의 메시지 큐(그룹 메시지 큐)에 전달
'그룹 생성', '세션의 그룹 이동', '그룹 간 메시지 송신 및 포워딩' 기능(CreateGroup, Enter/ForwardSessionGroup, SendGroupMessage) 제공
더 자세히 ...
#include <JNetCore.h>
Public 멤버 함수 | |
| JNetGroupServer (const char *serverIP, uint16 serverPort, uint16 maximumOfConnections, BYTE packetCode_LAN, BYTE packetCode, BYTE packetSymmetricKey, bool recvBufferingMode, uint16 maximumOfSessions, uint32 numOfIocpConcurrentThrd, uint16 numOfIocpWorkerThrd, size_t tlsMemPoolUnitCnt, size_t tlsMemPoolUnitCapacity, uint32 memPoolBuffAllocSize, uint32 sessionRecvBuffSize, bool calcTpsThread) | |
| void | CreateGroup (GroupID newGroupID, JNetGroupThread *groupThread, bool threadPriorBoost=false) |
| 그룹 생성 (그룹 식별자 반환, 라이브러리와 컨텐츠는 그룹 식별자를 통해 식별) | |
| void | DeleteGroup (GroupID delGroupID) |
| void | EnterSessionGroup (SessionID64 sessionID, GroupID enterGroup) |
| 세션의 특정 그룹 입장 | |
| void | LeaveSessionGroup (SessionID64 sessionID) |
| void | ForwardSessionGroup (SessionID64 sessionID, GroupID from, GroupID to) |
| 세션의 그룹 이동 | |
| void | ForwardMessage (SessionID64 sessionID, JBuffer *msg) |
| 세션 수신 메시지 포워딩 | |
| void | SendGroupMessage (GroupID from, GroupID to, JBuffer *groupMsg) |
| 그룹 간 메시지 송신 | |
jnet::JNetServer(으)로부터 상속된 Public 멤버 함수 | |
| JNetServer (const char *serverIP, uint16 serverPort, uint16 maximumOfConnections, PACKET_CODE packetCode_LAN, PACKET_CODE packetCode, PACKET_SYMM_KEY packetSymmetricKey, bool recvBufferingMode, uint16 maximumOfSessions, uint32 numOfIocpConcurrentThrd, uint16 numOfIocpWorkerThrd, size_t tlsMemPoolUnitCnt, size_t tlsMemPoolUnitCapacity, uint32 memPoolBuffAllocSize, uint32 sessionRecvBuffSize, bool calcTpsThread) | |
| bool | Start () |
| void | Stop () |
| void | PrintServerInfoOnConsole () |
jnet::JNetCore(으)로부터 상속된 Public 멤버 함수 | |
| JNetCore (uint16 maximumOfSessions, uint32 numOfIocpConcurrentThrd, uint16 numOfIocpWorkerThrd, size_t tlsMemPoolUnitCnt, size_t tlsMemPoolUnitCapacity, uint32 memPoolBuffAllocSize, uint32 sessionRecvBuffSize, bool calcTpsThread) | |
| ~JNetCore () | |
| bool | Start () |
| void | Stop () |
| uint16 | GetCurrentSessions () |
| int64 | GetCurrentAllocatedMemUnitCnt () |
| int | GetSessionCount () |
| UINT | GetAcceptTPS () |
| UINT | GetRecvTPS () |
| UINT | GetSendTPS () |
| UINT64 | GetTotalAcceptTransaction () |
| UINT64 | GetTotalRecvTransaction () |
| UINT64 | GetTotalSendTransaction () |
| void | IncrementRecvTransactions (bool threadSafe, UINT incre) |
| void | IncrementSendTransactions (bool threadSafe, UINT incre) |
| void | IncrementAcceptTransactions (bool threadSafe=false, UINT incre=1) |
Private 멤버 함수 | |
| virtual void | OnRecv (SessionID64 sessionID, JSerialBuffer &recvSerialBuff) override |
| 패킷 수신 시 호출되는 이벤트 함수, 수신 버퍼링 모드의 서버 전용 | |
| virtual void | OnRecv (SessionID64 sessionID, JBuffer &recvBuff) override |
| 패킷 수신 시 호출되는 이벤트 함수 | |
Private 속성 | |
| std::unordered_map< SessionID64, GroupID > | m_SessionGroupMap |
| 세션-그룹 맵핑 | |
| SRWLOCK | m_SessionGroupMapSrwLock |
| std::map< GroupID, JNetGroupThread * > | m_GroupThreads |
| 그룹-그룹 스레드 맵핑 | |
Friends | |
| class | JNetGroupThread |
추가로 상속된 멤버들 | |
jnet::JNetServer(으)로부터 상속된 Protected 멤버 함수 | |
| virtual void | OnPrintLogOnConsole () |
| bool | SendPacket (SessionID64 sessionID, JBuffer *sendPktPtr, bool postToWorker=false, bool encoded=false) |
| JNetCore 요청 함수 + 송신 패킷 인코딩 기능 | |
| bool | SendPacketBlocking (SessionID64 sessionID, JBuffer *sendPktPtr, bool encoded=false) |
| bool | BufferSendPacket (SessionID64 sessionID, JBuffer *sendPktPtr, bool encoded=false) |
| JBuffer * | AllocSerialSendBuff (uint16 len, bool LAN=false) |
| 직렬화 패킷 버퍼 할당 + 헤더 초기화 | |
| virtual bool | OnConnectionRequest (const SOCKADDR_IN &clientSockAddr) |
| Accept 반환 시 호출되는 이벤트 함수, 클라이언트 수용 여부를 반환을 통해 결정 | |
| virtual void | OnClientJoin (SessionID64 sessionID, const SOCKADDR_IN &clientSockAddr)=0 |
| 클라이언트 연결 수용 후 정상적으로 세션을 생성한 이 후 호출되는 이벤트 함수 | |
| virtual void | OnClientLeave (SessionID64 sessionID)=0 |
| 클라이언트와의 연결 종료 및 클라이언트 세션 제거 후 호출되는 이벤트 함수 | |
jnet::JNetCore(으)로부터 상속된 Protected 멤버 함수 | |
| void | PrintLibraryInfoOnConsole () |
| JNetSession * | CreateNewSession (SOCKET sock) |
| 하위 클래스에서 세션 객체 생성 요청을 위해 호출하는 함수 | |
| bool | RegistSessionToIOCP (JNetSession *session) |
| 하위 클래스에서 세션 객체를 IOCP 등록을 위해 호출하는 함수 | |
| bool | DeleteSession (SessionID64 sessionID) |
| 세션 제거 요청 함수 | |
| void | Disconnect (SessionID64 sessionID) |
| bool | SendPacket (SessionID64 sessionID, JBuffer *sendPktPtr, bool postToWorker=false) |
| 패킷 송신 요청 함수 | |
| bool | SendPacketBlocking (SessionID64 sessionID, JBuffer *sendPktPtr) |
| 동기식 송신 요청 함수 | |
| bool | BufferSendPacket (SessionID64 sessionID, JBuffer *sendPktPtr) |
| 세션 송신 버퍼 큐에 버퍼링(삽입만 진행) | |
| bool | SendBufferedPacket (SessionID64 sessionID, bool postToWorker=false) |
| 세션 송신 버퍼 큐 내 송신 패킷 직렬화 버퍼에 대한 일괄 송신 작업 수행 | |
| DWORD | AllocTlsMemPool () |
| 직렬화 패킷 버퍼 Tls 풀 할당 함수 | |
| JBuffer * | AllocSerialBuff () |
| 직렬화 패킷 버퍼 할당 요청 wrapper | |
| void | FreeSerialBuff (JBuffer *buff) |
| 직렬화 패킷 버퍼 반환 wrapper | |
| void | AddRefSerialBuff (JBuffer *buff) |
| 직렬화 패킷 버퍼 참조 카운트 증가 wrapper | |
| virtual bool | OnWorkerThreadCreate (HANDLE thHnd) |
| Start() 함수 내 IOCP 작업자 스레드 생성(CREATE_SUSPENDED) 후 호출되는 이벤트 함수 | |
| virtual void | OnAllWorkerThreadCreate () |
| Start() 함수 내 요청된 수 만큼 IOCP 작업자 스레드를 생성한 후 함수를 빠져나오기 전 호출되는 이벤트 함수 | |
| virtual void | OnWorkerThreadStart () |
| 개별 IOCP 작업자 스레드의 수행 흐름 초입부(WorkerThreadFunc 함수 초입부)에 호출되는 이벤트 함수, 개별 작업자 스레드의 초기화를 독립적으로 수행하도록 재정의 가능 | |
| virtual void | OnWorkerThreadEnd () |
| 개별 IOCP 작업자 스레드가 종료(작업자 함수 return) 전 호출되는 이벤트 함수 | |
| virtual void | OnError () |
jnet::JNetServer(으)로부터 상속된 Protected 속성 | |
| BYTE | m_PacketCode_LAN |
| LAN 구간 패킷 코드 | |
| BYTE | m_PacketCode |
| LAN 외부 통신 패킷 코드 | |
| BYTE | m_PacketSymmetricKey |
| 대칭-키 | |
jnet::JNetCore(으)로부터 상속된 Protected 속성 | |
| bool | m_CalcTpsFlag |
클라이언트 세션을 그룹 단위로 묶고, 'JNetGroupThread' 인스턴스의 메시지 큐(그룹 메시지 큐)에 전달
'그룹 생성', '세션의 그룹 이동', '그룹 간 메시지 송신 및 포워딩' 기능(CreateGroup, Enter/ForwardSessionGroup, SendGroupMessage) 제공
|
inline |
| void JNetGroupServer::CreateGroup | ( | GroupID | newGroupID, |
| JNetGroupThread * | groupThread, | ||
| bool | threadPriorBoost = false ) |
그룹 생성 (그룹 식별자 반환, 라이브러리와 컨텐츠는 그룹 식별자를 통해 식별)
| void JNetGroupServer::DeleteGroup | ( | GroupID | delGroupID | ) |
| void JNetGroupServer::EnterSessionGroup | ( | SessionID64 | sessionID, |
| GroupID | enterGroup ) |
세션의 특정 그룹 입장
| void JNetGroupServer::LeaveSessionGroup | ( | SessionID64 | sessionID | ) |
| void JNetGroupServer::ForwardSessionGroup | ( | SessionID64 | sessionID, |
| GroupID | from, | ||
| GroupID | to ) |
세션의 그룹 이동
| void jnet::jgroup::JNetGroupServer::ForwardMessage | ( | SessionID64 | sessionID, |
| JBuffer * | msg ) |
세션 수신 메시지 포워딩
| void jnet::jgroup::JNetGroupServer::SendGroupMessage | ( | GroupID | from, |
| GroupID | to, | ||
| JBuffer * | groupMsg ) |
그룹 간 메시지 송신
|
overrideprivatevirtual |
패킷 수신 시 호출되는 이벤트 함수, 수신 버퍼링 모드의 서버 전용
| recvSerialBuff | 복수의 수신 직렬화 버퍼를 추상화한 'JSerialBuffer' |
jnet::JNetServer(으)로부터 재구현되었습니다.
|
overrideprivatevirtual |
패킷 수신 시 호출되는 이벤트 함수
| recvBuff | jnet 정의 헤더 + 페이로드 단위의 낱개 수신 직렬화 버퍼 |
jnet::JNetServer(으)로부터 재구현되었습니다.
|
friend |
|
private |
세션-그룹 맵핑
|
private |
|
private |
그룹-그룹 스레드 맵핑