Udp Acceptor
[folly.git] / folly / io / async / AsyncUDPServerSocket.h
index 9feb6d41f2ee45d486ba8dec58a0ce2531805fb2..e424e83d9bd4ab35ce0b9752b57cd45e37962129 100644 (file)
@@ -36,7 +36,8 @@ namespace folly {
  *       more than 1 packet will not work because they will end up with
  *       different event base to process.
  */
-class AsyncUDPServerSocket : private AsyncUDPSocket::ReadCallback {
+class AsyncUDPServerSocket : private AsyncUDPSocket::ReadCallback
+                           , public AsyncSocketBase {
  public:
   class Callback {
    public:
@@ -93,6 +94,10 @@ class AsyncUDPServerSocket : private AsyncUDPSocket::ReadCallback {
     return socket_->address();
   }
 
+  void getAddress(SocketAddress* a) const {
+    *a = address();
+  }
+
   /**
    * Add a listener to the round robin list
    */
@@ -124,6 +129,10 @@ class AsyncUDPServerSocket : private AsyncUDPSocket::ReadCallback {
     socket_.reset();
   }
 
+  EventBase* getEventBase() const {
+    return evb_;
+  }
+
  private:
   // AsyncUDPSocket::ReadCallback
   void getReadBuffer(void** buf, size_t* len) noexcept {