ListenServer.h
资源名称:GGBT.rar [点击查看]
上传用户:lds876
上传日期:2013-05-25
资源大小:567k
文件大小:1k
源码类别:
P2P编程
开发平台:
Visual C++
- // ListenServer.h: interface for the CListenServer class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_LISTENSERVER_H__CC2939F3_A642_4A2B_9CB7_B98CA03B2E30__INCLUDED_)
- #define AFX_LISTENSERVER_H__CC2939F3_A642_4A2B_9CB7_B98CA03B2E30__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- class CListenServer
- {
- public:
- void StopListening();
- SOCKET GetResult();
- static DWORD WINAPI ListenProc(void* pParam);
- bool Accept(HANDLE hevAccept);
- long Bind(long lminport, long lmaxport);
- CListenServer();
- virtual ~CListenServer();
- operator SOCKET();
- private:
- void Listening();
- SOCKET m_hServer;
- HANDLE m_hevAccept;
- SOCKET m_hnewSocket;
- CCriticalSection m_sec;
- };
- #endif // !defined(AFX_LISTENSERVER_H__CC2939F3_A642_4A2B_9CB7_B98CA03B2E30__INCLUDED_)