Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions muduo/net/Channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,9 @@

#include <sstream>

#include <poll.h>

using namespace muduo;
using namespace muduo::net;

const int Channel::kNoneEvent = 0;
const int Channel::kReadEvent = POLLIN | POLLPRI;
const int Channel::kWriteEvent = POLLOUT;

Channel::Channel(EventLoop* loop, int fd__)
: loop_(loop),
fd_(fd__),
Expand Down
7 changes: 4 additions & 3 deletions muduo/net/Channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <functional>
#include <memory>
#include <poll.h>

namespace muduo
{
Expand Down Expand Up @@ -86,9 +87,9 @@ class Channel : noncopyable
void update();
void handleEventWithGuard(Timestamp receiveTime);

static const int kNoneEvent;
static const int kReadEvent;
static const int kWriteEvent;
static constexpr int kNoneEvent = 0;
static constexpr int kReadEvent = POLLIN | POLLPRI;
static constexpr int kWriteEvent = POLLOUT;

EventLoop* loop_;
const int fd_;
Expand Down