mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-10 16:19:23 +00:00
Added slot for poll creation.
This commit is contained in:
@@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <rak/error_number.h>
|
#include <torrent/exceptions.h>
|
||||||
#include <torrent/poll_epoll.h>
|
#include <torrent/poll_epoll.h>
|
||||||
#include <torrent/poll_kqueue.h>
|
#include <torrent/poll_kqueue.h>
|
||||||
#include <torrent/poll_select.h>
|
#include <torrent/poll_select.h>
|
||||||
@@ -85,7 +85,7 @@ create_poll() {
|
|||||||
log->push_front("Using 'select' based polling.");
|
log->push_front("Using 'select' based polling.");
|
||||||
|
|
||||||
else
|
else
|
||||||
throw std::runtime_error("Could not create any Poll object.");
|
throw torrent::internal_error("Could not create any Poll object.");
|
||||||
|
|
||||||
return poll;
|
return poll;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,12 +37,12 @@
|
|||||||
#ifndef RTORRENT_CORE_POLL_MANAGER_H
|
#ifndef RTORRENT_CORE_POLL_MANAGER_H
|
||||||
#define RTORRENT_CORE_POLL_MANAGER_H
|
#define RTORRENT_CORE_POLL_MANAGER_H
|
||||||
|
|
||||||
#include <rak/timer.h>
|
|
||||||
#include <sigc++/signal.h>
|
|
||||||
#include <torrent/poll.h>
|
|
||||||
|
|
||||||
#include "curl_stack.h"
|
#include "curl_stack.h"
|
||||||
|
|
||||||
|
namespace torrent {
|
||||||
|
class Poll;
|
||||||
|
}
|
||||||
|
|
||||||
namespace core {
|
namespace core {
|
||||||
|
|
||||||
torrent::Poll* create_poll();
|
torrent::Poll* create_poll();
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
#include <torrent/http.h>
|
#include <torrent/http.h>
|
||||||
#include <torrent/torrent.h>
|
#include <torrent/torrent.h>
|
||||||
#include <torrent/exceptions.h>
|
#include <torrent/exceptions.h>
|
||||||
|
#include <torrent/poll.h>
|
||||||
#include <torrent/data/chunk_utils.h>
|
#include <torrent/data/chunk_utils.h>
|
||||||
#include <torrent/utils/log.h>
|
#include <torrent/utils/log.h>
|
||||||
#include <rak/functional.h>
|
#include <rak/functional.h>
|
||||||
@@ -195,6 +196,7 @@ main(int argc, char** argv) {
|
|||||||
// to process new non-socket events.
|
// to process new non-socket events.
|
||||||
SignalHandler::set_handler(SIGUSR1, sigc::ptr_fun(&do_nothing));
|
SignalHandler::set_handler(SIGUSR1, sigc::ptr_fun(&do_nothing));
|
||||||
|
|
||||||
|
torrent::Poll::slot_create_poll() = std::tr1::bind(&core::create_poll);
|
||||||
torrent::initialize(main_thread->poll());
|
torrent::initialize(main_thread->poll());
|
||||||
|
|
||||||
// Initialize option handlers after libtorrent to ensure
|
// Initialize option handlers after libtorrent to ensure
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
|
|
||||||
#include <torrent/exceptions.h>
|
#include <torrent/exceptions.h>
|
||||||
|
#include <torrent/poll.h>
|
||||||
|
|
||||||
ThreadMain::~ThreadMain() {
|
ThreadMain::~ThreadMain() {
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user