PeerComm.h
上传用户:hysujiao87
上传日期:2007-12-02
资源大小:156k
文件大小:1k
- #pragma once
- #include "QQSocket.h"
- typedef struct tagListenParam
- {
- CEvent *finishEvent;
- CWnd *wnd;
-
- sockaddr_in serverAddr;
- CString userID;
- }LISTEN_PARAM;
- #define WM_PEER_NOTIFY WM_USER + 103
- class CPeerComm
- {
- protected:
- CEvent _finishEvent;
- HANDLE _listenThread;
- static UINT listenProc(LPVOID param);
-
- public:
- CPeerComm(void);
- virtual ~CPeerComm(void);
- HRESULT sendMsgToFriend(CString msg, const sockaddr_in &friendAddr, CString userID);
- HRESULT startListen(CWnd *wnd, CString userID, const sockaddr_in &serverAddr);
- HRESULT stopListen();
-
- static HRESULT sendOnlineRequest(SOCKET sock, const sockaddr_in &serverAddr, LPCTSTR userID);
- };