-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSocketManager.h
44 lines (33 loc) · 1.07 KB
/
SocketManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// SocketManager.h: interface for the CSocketManager class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_SOCKETMANAGER_H__7403BD71_338A_4531_BD91_3D7E5B505793__INCLUDED_)
#define AFX_SOCKETMANAGER_H__7403BD71_338A_4531_BD91_3D7E5B505793__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "SocketComm.h"
class CMyRichEditCtrl;
#define WM_UPDATE_CONNECTION WM_APP+0x1234
struct stMessageProxy
{
SockAddrIn address;
BYTE byData[BUFFER_SIZE];
};
class CSocketManager : public CSocketComm
{
public:
CSocketManager(int iIndex);
virtual ~CSocketManager();
int m_iIndex;
void SetMessageWindow(CMyRichEditCtrl* pMsgCtrl);
void AppendMessage(CString strText);
public:
CString itos(int i);
virtual void OnDataReceived(const LPBYTE lpBuffer, DWORD dwCount);
virtual void OnEvent(UINT uEvent);
protected:
void DisplayData(const LPBYTE lpData, DWORD dwCount, const SockAddrIn& sfrom);
CMyRichEditCtrl* m_pMsgCtrl;
};
#endif // !defined(AFX_SOCKETMANAGER_H__7403BD71_338A_4531_BD91_3D7E5B505793__INCLUDED_)