| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #include "stdafx.h"
- #include "LNTCPClient.h"
- #include "LNBuffer.h"
- CLNTCPClient::CLNTCPClient(void)
- {
- m_Handle = NULL;
- this->m_pBuffer = new CLNBuffer();
- }
- CLNTCPClient::~CLNTCPClient(void)
- {
- }
- void CLNTCPClient::ProcessPack(LPBYTE pPack, int nLen)
- {
- if (m_Handle){
- m_Handle->HandlePack(pPack, nLen, NULL, this);
- }
- else {
- ASSERT(0);
- }
- }
- void CLNTCPClient::SetProtocolHandler(CProtocolHandler* pHandle)
- {
- m_Handle = pHandle;
- }
- int CLNTCPClient::Send(const void* lpBuf, int nBufLen, int nFlags /*= 0*/)
- {
- if (CTCPClientSocket::IsConnected()){
- return CEventSocket::Send(lpBuf, nBufLen, nFlags);
- }
- return -1;
- }
- void CLNTCPClient::OnClose(int nErrorCode)
- {
- __super::OnClose(nErrorCode);
- }
|