MailSocket.cpp
资源名称:SmartMailSvr [点击查看]
上传用户:qdlutongda
上传日期:2007-01-14
资源大小:133k
文件大小:2k
源码类别:
Email客户端
开发平台:
Visual C++
- // MailSocket.cpp : implementation file
- //
- #include "stdafx.h"
- #include "smartmailsvr.h"
- #include "MailSocket.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /***************************************/
- extern CLogFile m_logFile;
- extern UINT fun_AcceptThread(LPVOID); //接收连接线程函数
- extern UINT fun_ReceiveThread(LPVOID); //接收请求,并处理数据线程函数
- /***************************************/
- /////////////////////////////////////////////////////////////////////////////
- // CClientSocket
- IMPLEMENT_DYNAMIC(CClientSocket, CSocket)
- CClientSocket::CClientSocket()
- {
- }
- void CClientSocket::OnReceive(int nErrorCode)
- {
- CAsyncSocket::OnReceive(nErrorCode);
- }
- void CClientSocket::OnConnect(int nErrorCode)
- {
- CAsyncSocket::OnConnect(nErrorCode);
- }
- int CClientSocket::Send(const void* lpBuf, int nBufLen, int nFlags)
- {
- #ifdef _TKDEBUG
- char sendstr[255];
- sprintf(sendstr,"%s",lpBuf);
- #endif
- return CAsyncSocket::Send(lpBuf, nBufLen, nFlags);
- }
- void CClientSocket::OnClose(int nErrorCode)
- {
- CAsyncSocket::OnClose(nErrorCode);
- }
- /////////////////////////////////////////////////////////////////////////////
- // CSocket Implementation
- // Do not edit the following lines, which are needed by ClassWizard.
- #if 0
- BEGIN_MESSAGE_MAP(CClientSocket, CAsyncSocket)
- //{{AFX_MSG_MAP(CClientSocket)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- #endif // 0
- /////////////////////////////////////////////////////////////////////////////
- // CClientSocket member functions
- /////////////////////////////////////////////////////////////////////////////
- // CListeningSocket
- CListeningSocket::CListeningSocket()
- {
- }
- CListeningSocket::~CListeningSocket()
- {
- }
- /////////////////////////////////////////////////////////////////////////////
- // CListeningSocket Overridable callbacks
- IMPLEMENT_DYNAMIC(CListeningSocket, CSocket)
- void CListeningSocket::OnAccept(int nErrorCode)
- {
- CAsyncSocket::OnAccept(nErrorCode);
- }
- // Do not edit the following lines, which are needed by ClassWizard.
- #if 0
- BEGIN_MESSAGE_MAP(CListeningSocket, CAsyncSocket)
- //{{AFX_MSG_MAP(CListeningSocket)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- #endif // 0
- /////////////////////////////////////////////////////////////////////////////
- // CListeningSocket member functions