mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
32 lines
621 B
C++
32 lines
621 B
C++
/**
|
|
*
|
|
* Poller.cc
|
|
* An Tao
|
|
*
|
|
* Public header file in trantor lib.
|
|
*
|
|
* Copyright 2018, An Tao. All rights reserved.
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the License file.
|
|
*
|
|
*
|
|
*/
|
|
|
|
#include "core/loops/poller.h"
|
|
#ifdef __linux__
|
|
#include "poller/epoll_poller.h"
|
|
#elif defined _WIN32
|
|
#include "Wepoll.h"
|
|
#include "poller/epoll_poller.h"
|
|
#else
|
|
#include "poller/kqueue.h"
|
|
#endif
|
|
using namespace trantor;
|
|
Poller *Poller::newPoller(EventLoop *loop) {
|
|
#if defined __linux__ || defined _WIN32
|
|
return new EpollPoller(loop);
|
|
#else
|
|
return new KQueue(loop);
|
|
#endif
|
|
}
|