Skip to content

Commit 5180bba

Browse files
authored
Add updateEvents() method to the Channel class (#97)
1 parent 6ed38a0 commit 5180bba

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

trantor/net/Channel.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,11 @@ class Channel : NonCopyable
146146
return events_ & kReadEvent;
147147
}
148148

149+
void updateEvents(int events)
150+
{
151+
events_ = events;
152+
update();
153+
}
149154
static const int kNoneEvent;
150155
static const int kReadEvent;
151156
static const int kWriteEvent;

trantor/net/InetAddress.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
#ifdef _WIN32
1515
struct in6_addr_uint
1616
{
17-
union {
17+
union
18+
{
1819
u_char Byte[16];
1920
u_short Word[8];
2021
uint32_t __s6_addr32[4];

trantor/net/InetAddress.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ class InetAddress
100100
}
101101

102102
private:
103-
union {
103+
union
104+
{
104105
struct sockaddr_in addr_;
105106
struct sockaddr_in6 addr6_;
106107
};

0 commit comments

Comments
 (0)