38 lines
662 B
C++
38 lines
662 B
C++
// ClientSocket.cpp : implementation file
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
//#include "DustCleanHMI.h"
|
|
#include "ClientSocket.h"
|
|
|
|
#include "CommDataDef.h"
|
|
// CClientSocket
|
|
|
|
CClientSocket::CClientSocket()
|
|
{
|
|
m_hSocket = INVALID_SOCKET;
|
|
}
|
|
|
|
CClientSocket::~CClientSocket()
|
|
{
|
|
}
|
|
|
|
|
|
// CClientSocket member functions
|
|
|
|
void CClientSocket::OnReceive(int nErrorCode)
|
|
{
|
|
//发送消息由对应的线程读取数据
|
|
m_pThrd->PostThreadMessage(WM_THREAD_RECV,WP_WPARA_RECV,0);
|
|
|
|
CSocket::OnReceive(nErrorCode);
|
|
}
|
|
|
|
void CClientSocket::OnClose(int nErrorCode)
|
|
{
|
|
//发送消息由对应的线程关闭本地Socket
|
|
m_pThrd->PostThreadMessage(WM_THREAD_RECV, WP_WPARA_CLOSE, 0);
|
|
|
|
CSocket::OnClose(nErrorCode);
|
|
}
|