#include <vmsBtSessionImpl.h>

Public Member Functions | |
| void | RestoreDownloadHandle (vmsBtDownloadImpl *dld) |
| void | ListenOn (int portFrom, int portTo) |
| BOOL | IsListening () |
| USHORT | get_ListenPort () |
| vmsBtDownload * | CreateDownload (vmsBtFile *torrent, LPCSTR pszOutputPath, LPBYTE pbFastResumeData, DWORD dwFRDataSize, BOOL bCompactMode) |
| void | SetDownloadLimit (int limit) |
| void | SetUploadLimit (int limit) |
| void | SetMaxUploads (int limit) |
| void | DeleteDownload (vmsBtDownload *) |
| void | DHT_start (LPBYTE pbState, DWORD dwStateSize) |
| void | DHT_stop () |
| BOOL | DHT_getState (LPBYTE pbBuffer, DWORD dwBufferSize, LPDWORD pdwDataSize) |
| BOOL | DHT_isStarted () |
| void | set_EventsHandler (fntBtSessionEventsHandler pfn, LPVOID pData) |
| void | SetProxySettings (LPCSTR pszIp, int nPort, LPCSTR pszUser, LPCSTR pszPwd) |
| int | get_TotalDownloadConnectionCount () |
| int | get_DownloadCount () |
| vmsBtDownload * | get_Download (int nIndex) |
| int | get_TotalDownloadSpeed () |
| int | get_TotalUploadSpeed () |
| UINT64 | get_TotalDownloadedByteCount () |
| UINT64 | get_TotalUploadedByteCount () |
| void | SetUserAgent (LPCSTR pszUA) |
| vmsBtSessionImpl (void) | |
| virtual | ~vmsBtSessionImpl (void) |
Static Public Member Functions | |
| static vmsBtSessionImpl * | Instance () |
Public Attributes | |
| session | m_session |
Protected Member Functions | |
| int | FindDownloadIndex (const torrent_handle &h) |
Static Protected Member Functions | |
| static DWORD WINAPI | _threadSession (LPVOID lp) |
Protected Attributes | |
| bool | m_bThreadRunning |
| bool | m_bNeedStop |
| BOOL | m_bDHTstarted |
| fntBtSessionEventsHandler | m_pfnEvHandler |
| LPVOID | m_pEvData |
| std::vector< vmsBtDownloadImpl * > | m_vDownloads |
| CRITICAL_SECTION | m_csRestoreTorrentHandle |
| CRITICAL_SECTION | m_csDeleteDownload |
Definition at line 9 of file vmsBtSessionImpl.h.
| vmsBtSessionImpl::vmsBtSessionImpl | ( | void | ) |
Definition at line 21 of file vmsBtSessionImpl.cpp.
References _threadSession(), libtorrent::session::add_extension(), libtorrent::create_ut_pex_plugin(), FALSE, simple_client::info, m_bDHTstarted, m_bNeedStop, m_bThreadRunning, m_csDeleteDownload, m_csRestoreTorrentHandle, m_pfnEvHandler, m_session, NULL, libtorrent::session::set_max_half_open_connections(), and libtorrent::session::set_severity_level().
| vmsBtSessionImpl::~vmsBtSessionImpl | ( | void | ) | [virtual] |
Definition at line 37 of file vmsBtSessionImpl.cpp.
References m_bNeedStop, m_bThreadRunning, m_csDeleteDownload, and m_csRestoreTorrentHandle.
| void vmsBtSessionImpl::RestoreDownloadHandle | ( | vmsBtDownloadImpl * | dld | ) |
Definition at line 348 of file vmsBtSessionImpl.cpp.
References libtorrent::session::add_torrent(), BTSET_BTDLD_WAS_RESET, vmsBtSessionEvent::enType, libtorrent::torrent_handle::is_valid(), m_csRestoreTorrentHandle, vmsBtDownloadImpl::m_handle, m_pEvData, m_pfnEvHandler, vmsBtDownloadImpl::m_pTorrent, m_session, vmsBtDownloadImpl::m_strOutputPath, vmsBtFileImpl::m_torrent, NULL, libtorrent::torrent_handle::pause(), vmsBtSessionEvent::pDownload, and vmsBtSessionEvent::pszMsg.
Referenced by vmsBtDownloadImpl::check_handle_is_valid().
| void vmsBtSessionImpl::ListenOn | ( | int | portFrom, | |
| int | portTo | |||
| ) | [virtual] |
Reimplemented from vmsBtSession.
Definition at line 126 of file vmsBtSessionImpl.cpp.
References libtorrent::session::listen_on(), and m_session.
| BOOL vmsBtSessionImpl::IsListening | ( | ) | [virtual] |
Reimplemented from vmsBtSession.
Definition at line 131 of file vmsBtSessionImpl.cpp.
References libtorrent::session::is_listening(), and m_session.
| USHORT vmsBtSessionImpl::get_ListenPort | ( | ) | [virtual] |
Reimplemented from vmsBtSession.
Definition at line 136 of file vmsBtSessionImpl.cpp.
References libtorrent::session::listen_port(), and m_session.
| vmsBtDownload * vmsBtSessionImpl::CreateDownload | ( | vmsBtFile * | torrent, | |
| LPCSTR | pszOutputPath, | |||
| LPBYTE | pbFastResumeData, | |||
| DWORD | dwFRDataSize, | |||
| BOOL | bCompactMode | |||
| ) | [virtual] |
Reimplemented from vmsBtSession.
Definition at line 46 of file vmsBtSessionImpl.cpp.
References libtorrent::session::add_torrent(), vmsBtFileImpl::AddRef(), libtorrent::bdecode(), LPSTR, vmsBtDownloadImpl::m_handle, vmsBtDownloadImpl::m_pTorrent, m_session, vmsBtDownloadImpl::m_strOutputPath, vmsBtFileImpl::m_torrent, m_vDownloads, NULL, and libtorrent::torrent_handle::set_ratio().
| void vmsBtSessionImpl::SetDownloadLimit | ( | int | limit | ) | [virtual] |
Reimplemented from vmsBtSession.
Definition at line 116 of file vmsBtSessionImpl.cpp.
References m_session, and libtorrent::session::set_download_rate_limit().
| void vmsBtSessionImpl::SetUploadLimit | ( | int | limit | ) | [virtual] |
Reimplemented from vmsBtSession.
Definition at line 121 of file vmsBtSessionImpl.cpp.
References m_session, and libtorrent::session::set_upload_rate_limit().
| void vmsBtSessionImpl::SetMaxUploads | ( | int | limit | ) | [virtual] |
Reimplemented from vmsBtSession.
Definition at line 141 of file vmsBtSessionImpl.cpp.
References m_session, and libtorrent::session::set_max_uploads().
| void vmsBtSessionImpl::DeleteDownload | ( | vmsBtDownload * | pDld | ) | [virtual] |
Reimplemented from vmsBtSession.
Definition at line 82 of file vmsBtSessionImpl.cpp.
References FindDownloadIndex(), m_csDeleteDownload, vmsBtDownloadImpl::m_handle, m_session, m_vDownloads, and libtorrent::session::remove_torrent().
| void vmsBtSessionImpl::DHT_start | ( | LPBYTE | pbState, | |
| DWORD | dwStateSize | |||
| ) | [virtual] |
Reimplemented from vmsBtSession.
Definition at line 146 of file vmsBtSessionImpl.cpp.
References libtorrent::bdecode(), m_bDHTstarted, m_session, libtorrent::session::start_dht(), and TRUE.
| void vmsBtSessionImpl::DHT_stop | ( | ) | [virtual] |
Reimplemented from vmsBtSession.
Definition at line 154 of file vmsBtSessionImpl.cpp.
References FALSE, m_bDHTstarted, m_session, and libtorrent::session::stop_dht().
| BOOL vmsBtSessionImpl::DHT_getState | ( | LPBYTE | pbBuffer, | |
| DWORD | dwBufferSize, | |||
| LPDWORD | pdwDataSize | |||
| ) | [virtual] |
Reimplemented from vmsBtSession.
Definition at line 162 of file vmsBtSessionImpl.cpp.
References libtorrent::bencode(), libtorrent::session::dht_state(), FALSE, m_session, NULL, and TRUE.
| BOOL vmsBtSessionImpl::DHT_isStarted | ( | ) | [virtual] |
Reimplemented from vmsBtSession.
Definition at line 181 of file vmsBtSessionImpl.cpp.
References m_bDHTstarted.
| void vmsBtSessionImpl::set_EventsHandler | ( | fntBtSessionEventsHandler | pfn, | |
| LPVOID | pData | |||
| ) | [virtual] |
Reimplemented from vmsBtSession.
Definition at line 321 of file vmsBtSessionImpl.cpp.
References m_pEvData, and m_pfnEvHandler.
| void vmsBtSessionImpl::SetProxySettings | ( | LPCSTR | pszIp, | |
| int | nPort, | |||
| LPCSTR | pszUser, | |||
| LPCSTR | pszPwd | |||
| ) | [virtual] |
Reimplemented from vmsBtSession.
Definition at line 338 of file vmsBtSessionImpl.cpp.
References m_session, libtorrent::session_settings::proxy_ip, libtorrent::session_settings::proxy_login, libtorrent::session_settings::proxy_password, libtorrent::session_settings::proxy_port, simple_client::s, libtorrent::session::set_settings(), and libtorrent::session::settings().
| int vmsBtSessionImpl::get_TotalDownloadConnectionCount | ( | ) | [virtual] |
Reimplemented from vmsBtSession.
Definition at line 379 of file vmsBtSessionImpl.cpp.
References m_vDownloads, and n.
| int vmsBtSessionImpl::get_DownloadCount | ( | ) | [virtual] |
Reimplemented from vmsBtSession.
Definition at line 387 of file vmsBtSessionImpl.cpp.
References m_vDownloads.
| vmsBtDownload * vmsBtSessionImpl::get_Download | ( | int | nIndex | ) | [virtual] |
Reimplemented from vmsBtSession.
Definition at line 392 of file vmsBtSessionImpl.cpp.
References m_vDownloads.
| int vmsBtSessionImpl::get_TotalDownloadSpeed | ( | ) | [virtual] |
Reimplemented from vmsBtSession.
Definition at line 397 of file vmsBtSessionImpl.cpp.
References m_session, libtorrent::session_status::payload_download_rate, and libtorrent::session::status().
| int vmsBtSessionImpl::get_TotalUploadSpeed | ( | ) | [virtual] |
Reimplemented from vmsBtSession.
Definition at line 402 of file vmsBtSessionImpl.cpp.
References m_session, libtorrent::session_status::payload_upload_rate, and libtorrent::session::status().
| UINT64 vmsBtSessionImpl::get_TotalDownloadedByteCount | ( | ) | [virtual] |
Reimplemented from vmsBtSession.
Definition at line 407 of file vmsBtSessionImpl.cpp.
References m_session, libtorrent::session::status(), and libtorrent::session_status::total_payload_download.
| UINT64 vmsBtSessionImpl::get_TotalUploadedByteCount | ( | ) | [virtual] |
Reimplemented from vmsBtSession.
Definition at line 412 of file vmsBtSessionImpl.cpp.
References m_session, libtorrent::session::status(), and libtorrent::session_status::total_payload_upload.
| void vmsBtSessionImpl::SetUserAgent | ( | LPCSTR | pszUA | ) | [virtual] |
Reimplemented from vmsBtSession.
Definition at line 417 of file vmsBtSessionImpl.cpp.
References m_session, simple_client::s, libtorrent::session::set_settings(), libtorrent::session::settings(), and libtorrent::session_settings::user_agent.
| vmsBtSessionImpl * vmsBtSessionImpl::Instance | ( | ) | [static] |
Definition at line 101 of file vmsBtSessionImpl.cpp.
References NULL.
Referenced by __declspec(), and vmsBtDownloadImpl::check_handle_is_valid().
| DWORD vmsBtSessionImpl::_threadSession | ( | LPVOID | lp | ) | [static, protected] |
Definition at line 186 of file vmsBtSessionImpl.cpp.
References asio::ip::basic_endpoint< InternetProtocol >::address(), BTSET_FILE_ERROR, BTSET_HASH_FAILED, BTSET_LISTEN_FAILED, BTSET_PEER_BAN, BTSET_PEER_ERROR, BTSET_TORRENT_FINISHED, BTSET_TRACKER, BTSET_TRACKER_ANNOUNCE, BTSET_TRACKER_REPLY, BTSET_TRACKER_WARNING, BTSET_URL_SEED, vmsBtSessionEvent::enType, FindDownloadIndex(), libtorrent::torrent_alert::handle, libtorrent::peer_error_alert::ip, libtorrent::peer_ban_alert::ip, m_bNeedStop, m_bThreadRunning, m_pEvData, m_pfnEvHandler, m_session, m_vDownloads, NULL, vmsBtSessionEvent::pDownload, libtorrent::hash_failed_alert::piece_index, vmsBtSessionEvent::piece_index, libtorrent::session::pop_alert(), vmsBtSessionEvent::pszIp, vmsBtSessionEvent::pszMsg, vmsBtSessionEvent::pszUrl, libtorrent::tracker_alert::status_code, vmsBtSessionEvent::status_code, libtorrent::tracker_alert::times_in_row, vmsBtSessionEvent::times_in_row, asio::ip::address::to_string(), and libtorrent::url_seed_alert::url.
Referenced by vmsBtSessionImpl().
| int vmsBtSessionImpl::FindDownloadIndex | ( | const torrent_handle & | h | ) | [protected] |
Referenced by _threadSession(), and DeleteDownload().
| session vmsBtSessionImpl::m_session |
Definition at line 42 of file vmsBtSessionImpl.h.
Referenced by _threadSession(), CreateDownload(), DeleteDownload(), DHT_getState(), DHT_start(), DHT_stop(), get_ListenPort(), get_TotalDownloadedByteCount(), get_TotalDownloadSpeed(), get_TotalUploadedByteCount(), get_TotalUploadSpeed(), IsListening(), ListenOn(), RestoreDownloadHandle(), SetDownloadLimit(), SetMaxUploads(), SetProxySettings(), SetUploadLimit(), SetUserAgent(), and vmsBtSessionImpl().
bool vmsBtSessionImpl::m_bThreadRunning [protected] |
Definition at line 46 of file vmsBtSessionImpl.h.
Referenced by _threadSession(), vmsBtSessionImpl(), and ~vmsBtSessionImpl().
bool vmsBtSessionImpl::m_bNeedStop [protected] |
Definition at line 46 of file vmsBtSessionImpl.h.
Referenced by _threadSession(), vmsBtSessionImpl(), and ~vmsBtSessionImpl().
BOOL vmsBtSessionImpl::m_bDHTstarted [protected] |
Definition at line 47 of file vmsBtSessionImpl.h.
Referenced by DHT_isStarted(), DHT_start(), DHT_stop(), and vmsBtSessionImpl().
Definition at line 48 of file vmsBtSessionImpl.h.
Referenced by _threadSession(), RestoreDownloadHandle(), set_EventsHandler(), and vmsBtSessionImpl().
LPVOID vmsBtSessionImpl::m_pEvData [protected] |
Definition at line 49 of file vmsBtSessionImpl.h.
Referenced by _threadSession(), RestoreDownloadHandle(), and set_EventsHandler().
std::vector<vmsBtDownloadImpl*> vmsBtSessionImpl::m_vDownloads [protected] |
Definition at line 52 of file vmsBtSessionImpl.h.
Referenced by _threadSession(), CreateDownload(), DeleteDownload(), get_Download(), get_DownloadCount(), and get_TotalDownloadConnectionCount().
CRITICAL_SECTION vmsBtSessionImpl::m_csRestoreTorrentHandle [protected] |
Definition at line 53 of file vmsBtSessionImpl.h.
Referenced by RestoreDownloadHandle(), vmsBtSessionImpl(), and ~vmsBtSessionImpl().
CRITICAL_SECTION vmsBtSessionImpl::m_csDeleteDownload [protected] |
Definition at line 54 of file vmsBtSessionImpl.h.
Referenced by DeleteDownload(), vmsBtSessionImpl(), and ~vmsBtSessionImpl().
1.5.6