Commit 432d60d6 authored by Neel Goyal's avatar Neel Goyal Committed by Facebook Github Bot

Change AsyncUDP's readCallback to be protected.

Summary: Change AsyncUDPSocket's ReadCallback to be protected so that subclasses can have access to it.

Reviewed By: yangchi

Differential Revision: D5376012

fbshipit-source-id: 7ec21d9bfe6bde525253adea7abf5dea15fb7fa0
parent 6a3a9eb0
...@@ -36,9 +36,9 @@ namespace folly { ...@@ -36,9 +36,9 @@ namespace folly {
AsyncUDPSocket::AsyncUDPSocket(EventBase* evb) AsyncUDPSocket::AsyncUDPSocket(EventBase* evb)
: EventHandler(CHECK_NOTNULL(evb)), : EventHandler(CHECK_NOTNULL(evb)),
readCallback_(nullptr),
eventBase_(evb), eventBase_(evb),
fd_(-1), fd_(-1) {
readCallback_(nullptr) {
evb->dcheckIsInEventBaseThread(); evb->dcheckIsInEventBaseThread();
} }
......
...@@ -167,6 +167,9 @@ class AsyncUDPSocket : public EventHandler { ...@@ -167,6 +167,9 @@ class AsyncUDPSocket : public EventHandler {
return ::sendmsg(socket, message, flags); return ::sendmsg(socket, message, flags);
} }
// Non-null only when we are reading
ReadCallback* readCallback_;
private: private:
AsyncUDPSocket(const AsyncUDPSocket&) = delete; AsyncUDPSocket(const AsyncUDPSocket&) = delete;
AsyncUDPSocket& operator=(const AsyncUDPSocket&) = delete; AsyncUDPSocket& operator=(const AsyncUDPSocket&) = delete;
...@@ -186,9 +189,6 @@ class AsyncUDPSocket : public EventHandler { ...@@ -186,9 +189,6 @@ class AsyncUDPSocket : public EventHandler {
// Temp space to receive client address // Temp space to receive client address
folly::SocketAddress clientAddress_; folly::SocketAddress clientAddress_;
// Non-null only when we are reading
ReadCallback* readCallback_;
bool reuseAddr_{true}; bool reuseAddr_{true};
bool reusePort_{false}; bool reusePort_{false};
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment