Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
64 lines
1.4 KiB
C++
64 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include <deque>
|
|
#include "HanUnitedBillingPacket.h"
|
|
|
|
// CBillingAsyncSocket ¸í·É ´ë»óÀÔ´Ï´Ù.
|
|
|
|
class CBillingAsyncSocket : public CAsyncSocket
|
|
{
|
|
public:
|
|
|
|
enum ConnectionMode
|
|
{
|
|
ACTIVE_CONNECTION,
|
|
PASSIVE_CONNECTION
|
|
};
|
|
|
|
static CBillingAsyncSocket* CreateBillingSocket(int nSocketType = SOCK_STREAM, UINT nSocketPort = 0);
|
|
|
|
void SendPending(const HanUnitedBilling::GLTransStruct& glTransStruct);
|
|
void SendPacket();
|
|
|
|
const SOCKADDR& GetPeerAddr() { return m_PeerAddress; }
|
|
const char* GetPeerAddrString() { return inet_ntoa(reinterpret_cast<SOCKADDR_IN&>(m_PeerAddress).sin_addr); }
|
|
|
|
virtual void OnAccept(int nErrorCode);
|
|
virtual void OnReceive(int nErrorCode);
|
|
virtual void OnSend(int nErrorCode);
|
|
virtual void OnClose(int nErrorCode);
|
|
virtual void OnConnect(int nErrorCode);
|
|
|
|
LONG AddRef();
|
|
LONG Release();
|
|
|
|
protected:
|
|
|
|
CBillingAsyncSocket();
|
|
virtual ~CBillingAsyncSocket();
|
|
|
|
private:
|
|
|
|
typedef std::deque<HanUnitedBilling::GLTransStruct> SendPacketList;
|
|
|
|
SOCKADDR m_PeerAddress;
|
|
int m_nAddressLen;
|
|
|
|
ConnectionMode m_eConnectionMode;
|
|
LONG m_nRefCount;
|
|
|
|
SendPacketList m_SendPacketList;
|
|
size_t m_nSendBytesFirstPacket;
|
|
|
|
enum
|
|
{
|
|
MAX_RECV_BUFFER = sizeof(HanUnitedBilling::GLTransStruct) * 10
|
|
};
|
|
|
|
char m_szRecvBuffer[MAX_RECV_BUFFER];
|
|
size_t m_nBufferUsed;
|
|
|
|
};
|
|
|
|
|