MyUdpSocket.h
上传用户:deligs
上传日期:2007-01-08
资源大小:43k
文件大小:2k
- #if !defined(AFX_MYUDPSOCKET_H__55CD9CE1_83D8_11D4_974C_0080C8F60D90__INCLUDED_)
- #define AFX_MYUDPSOCKET_H__55CD9CE1_83D8_11D4_974C_0080C8F60D90__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- // MyUdpSocket.h : header file
- //
- #include "LogIt.h"
- #include "MyUdpInfo.h"
- #define DEFAULT_IP "127.0.0.1"
- #define DEFAULT_CLIENTNAME "No Name"
- #define EVENT_UDP_CONNECTED 0x2000
- #define TIME_BETWEEN_RECEIVE 1000
- #define STAT_MYUDPC_SENDFIRST 0x5001
- #define STAT_MYUDPC_SENDSECOND 0x5002
- /////////////////////////////////////////////////////////////////////////////
- // CMyUdpSocket command target
- class CMyUdpSocket : public CAsyncSocket
- {
- // Attributes
- public:
- CString m_csAddress;
- CString m_csClientName;
- UINT m_uRemotePort;
- UINT m_uLocalPort;
- HWND m_hwndNotify;
- CLogIt* m_pLogFile;
- CMyUdpInfo* m_pMyUdpInfo;
- DWORD m_dwState;
- CString m_csModuleName;
- // Operations
- public:
- CMyUdpSocket();
- virtual ~CMyUdpSocket();
- BOOL Initial();
- void SendFirstPacket();
- private:
- BOOL ChecksumValid();
- // Overrides
- public:
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CMyUdpSocket)
- public:
- virtual void OnReceive(int nErrorCode);
- //}}AFX_VIRTUAL
- // Generated message map functions
- //{{AFX_MSG(CMyUdpSocket)
- // NOTE - the ClassWizard will add and remove member functions here.
- //}}AFX_MSG
- // Implementation
- protected:
- };
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_MYUDPSOCKET_H__55CD9CE1_83D8_11D4_974C_0080C8F60D90__INCLUDED_)