HP-Socket
HP-Socket copied to clipboard
Can i use customized client class in CTcpServer?
I want to use customized client class pointer in CTcpServer.
/* Customized client class */
class MyClient
{
...
}
/* CTcpServer OnAccept */
EnHandleResult MyServer::OnAccept(ITcpServer* pSender, CONNID dwConnID, UINT_PTR soClient)
{
...
MyClient *ptr = new MyClient(); // Create Client Point
// I want to register **ptr** to Server.
return HR_OK;
}
EnHandleResult MyServer::OnReceive(ITcpServer* pSender, CONNID dwConnID, const BYTE* pData, int iLength)
{
...
// I want to get **Client Class Ptr** from Server.
return HR_OK;
}
What should I do?
这是来自樊 邮箱的自动回复邮件。 您好,您发的邮件我已收到,我会及时查看并予以回复。
Yes, use SetConnectionExtra() to hold the custom data.
refer to \Windows\Demo\HttpProxy