00001 // 00002 // EDNeighbour.h 00003 // 00004 // Copyright (c) Shareaza Development Team, 2002-2005. 00005 // This file is part of SHAREAZA (www.shareaza.com) 00006 // 00007 // Shareaza is free software; you can redistribute it 00008 // and/or modify it under the terms of the GNU General Public License 00009 // as published by the Free Software Foundation; either version 2 of 00010 // the License, or (at your option) any later version. 00011 // 00012 // Shareaza is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU General Public License 00018 // along with Shareaza; if not, write to the Free Software 00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 // 00021 00022 #if !defined(AFX_EDNEIGHBOUR_H__7E77CD2A_D3AA_4E53_981B_3B4624968921__INCLUDED_) 00023 #define AFX_EDNEIGHBOUR_H__7E77CD2A_D3AA_4E53_981B_3B4624968921__INCLUDED_ 00024 00025 #pragma once 00026 00027 #include "Neighbour.h" 00028 00029 class CEDPacket; 00030 class CDownload; 00031 00032 00033 class CEDNeighbour : public CNeighbour 00034 { 00035 // Construction 00036 public: 00037 CEDNeighbour(); 00038 virtual ~CEDNeighbour(); 00039 00040 // Attributes 00041 public: 00042 DWORD m_nClientID; 00043 DWORD m_nUserCount; 00044 DWORD m_nUserLimit; 00045 DWORD m_nFileLimit; 00046 DWORD m_nTCPFlags; 00047 DWORD m_nUDPFlags; 00048 CString m_sServerName; 00049 00050 CPtrList m_pQueries; 00051 DWORD m_nFilesSent; 00052 00053 // Operations 00054 public: 00055 virtual BOOL ConnectTo(IN_ADDR* pAddress, WORD nPort, BOOL bAutomatic); 00056 virtual BOOL Send(CPacket* pPacket, BOOL bRelease = TRUE, BOOL bBuffered = FALSE); 00057 virtual BOOL SendQuery(CQuerySearch* pSearch, CPacket* pPacket, BOOL bLocal); 00058 protected: 00059 virtual BOOL OnRun(); 00060 virtual BOOL OnConnected(); 00061 virtual void OnDropped(BOOL bError); 00062 virtual BOOL OnRead(); 00063 public: 00064 BOOL SendSharedDownload(CDownload* pDownload); 00065 protected: 00066 BOOL OnPacket(CEDPacket* pPacket); 00067 BOOL OnRejected(CEDPacket* pPacket); 00068 BOOL OnServerMessage(CEDPacket* pPacket); 00069 BOOL OnIdChange(CEDPacket* pPacket); 00070 BOOL OnServerList(CEDPacket* pPacket); 00071 BOOL OnServerStatus(CEDPacket* pPacket); 00072 BOOL OnServerIdent(CEDPacket* pPacket); 00073 BOOL OnCallbackRequest(CEDPacket* pPacket); 00074 BOOL OnSearchResults(CEDPacket* pPacket); 00075 BOOL OnFoundSources(CEDPacket* pPacket); 00076 void SendSharedFiles(); 00077 00078 }; 00079 00080 #endif // !defined(AFX_EDNEIGHBOUR_H__7E77CD2A_D3AA_4E53_981B_3B4624968921__INCLUDED_)