ClientStructDefine.h
资源名称:p2p_vod.rar [点击查看]
上传用户:liguizhu
上传日期:2015-11-01
资源大小:2422k
文件大小:2k
源码类别:
P2P编程
开发平台:
Visual C++
- /*
- * Openmysee
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
- #pragma once
- #include "FreeList.h"
- #include "PushList.h"
- #include "IntervalArray.h"
- #include "MediaArray.h"
- #include ".externalTE_Socket.h"
- #include ".externalRand.h"
- #include ".externalmd5.h"
- #include "CriticalSection.h"
- #include "TransferCalculator.h"
- // 操作系统版本
- enum OS_Version {OS_UNKNOWN, OS_WIN95, OS_WIN98, OS_WINME,
- OS_WINNT40, OS_WIN2000, OS_WINXP, OS_WIN2003};
- // 配置信息
- class ConfigData {
- public:
- UINT GetSum() { return OUTGOING_NUM+INCOMING_NUM+OUT_4FREE_NUM+IN_4FREE_NUM;};
- UINT GetIncoming() { return INCOMING_NUM+IN_4FREE_NUM;};
- UINT GetOutgoing() { return OUTGOING_NUM+OUT_4FREE_NUM;};
- float COMMUNICATOR_VERSION; // 版本
- float ACCEPT_VERSION; // 可以接受的最低版本
- float ADD_PROGNAME_VERSION; // 增加了节目名的版本
- float ADD_PROGTIME_VERSION; // 增加了节目时间的版本
- UINT8 OUTGOING_NUM; // 最大连出连接
- UINT8 INCOMING_NUM; // 最大连入连接
- UINT8 OUT_4FREE_NUM; // 为他人做贡献的连出连接
- UINT8 IN_4FREE_NUM; // 为他人做贡献的连入连接
- string post_log_url; // 接收post log的页面url
- string module_base; // layer1.dll所在的目录
- int allow_post; // 是否允许post 1 允许, 0 不允许
- };
- struct ConnectingPeer : public PeerInfoWithAddr {
- // 连接中的SOCKET
- SOCKET sock;
- // 是否连入连接
- bool isIncoming;
- // 是否free连接
- bool isForFree;
- // 双方当前资源是否相同
- bool isSameRes;
- // 是否被动连接
- bool isPassive;
- // 是否内网连接
- bool isSameLan;
- // 开始连接的时间
- DWORD connectTime;
- };
- typedef list<PeerInfoWithAddr>::iterator PeerAddrIt;
- typedef list<ConnectingPeer>::iterator CPeerIt;