Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

UploadTransferED2K.h

Go to the documentation of this file.
00001 //
00002 // UploadTransferED2K.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_UPLOADTRANSFERED2K_H__04FAF448_0A7F_4566_97D2_38845BF71F20__INCLUDED_)
00023 #define AFX_UPLOADTRANSFERED2K_H__04FAF448_0A7F_4566_97D2_38845BF71F20__INCLUDED_
00024 
00025 #pragma once
00026 
00027 #include "UploadTransfer.h"
00028 #include "FileFragments.hpp"
00029 
00030 class CEDClient;
00031 class CEDPacket;
00032 
00033 class CUploadTransferED2K : public CUploadTransfer
00034 {
00035 // Construction
00036 public:
00037         CUploadTransferED2K(CEDClient* pClient);
00038         virtual ~CUploadTransferED2K();
00039         
00040 // Attributes
00041 public:
00042         CEDClient*              m_pClient;                                      // The remote client.
00043         DWORD                   m_tRequest;                                     // The time a request was sent.
00044         int                             m_nRanking;                                     // The last queue position the remote client was sent.
00045         DWORD                   m_tRankingSent;                         // The time a queue ranking packet was last sent.
00046         DWORD                   m_tRankingCheck;                        // The time the queue position was last checked.
00047         DWORD                   m_tLastRun;                                     // The time the transfer was last run
00048 private:
00049     FF::SimpleFragmentQueue m_oRequested;
00050     FF::SimpleFragmentQueue m_oServed;
00051 
00052 // Operations
00053 public:
00054         BOOL                    Request(MD4* pMD4);
00055         virtual void    Close(BOOL bMessage = FALSE);
00056         virtual BOOL    OnRun();
00057         virtual BOOL    OnConnected();
00058         virtual void    OnDropped(BOOL bError);
00059         virtual void    OnQueueKick();
00060         virtual DWORD   GetMeasuredSpeed();
00061 public:
00062         BOOL    OnRunEx(DWORD tNow);
00063         BOOL    OnQueueRelease(CEDPacket* pPacket);
00064         BOOL    OnRequestParts(CEDPacket* pPacket);
00065         BOOL    OnReask();
00066 protected:
00067         void    Cleanup(BOOL bDequeue = TRUE);
00068         void    Send(CEDPacket* pPacket, BOOL bRelease = TRUE);
00069         BOOL    CheckRanking();         // Check the client's Q rank. Start upload or send notification if required.
00070         void    AddRequest(QWORD nOffset, QWORD nLength);
00071         BOOL    ServeRequests();
00072         BOOL    OpenFile();
00073         BOOL    StartNextRequest();
00074         BOOL    DispatchNextChunk();
00075         BOOL    CheckFinishedRequest();
00076 
00077 };
00078 
00079 #endif // !defined(AFX_UPLOADTRANSFERED2K_H__04FAF448_0A7F_4566_97D2_38845BF71F20__INCLUDED_)

Generated on Thu Dec 15 10:39:51 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2