Allow underlying transport to be accessible from AsyncTransportWrapper
[folly.git] / folly / io / async / AsyncTransport.h
index ee8e8ea646e5d8d5fda2f97ebefb007e517dfcf1..26cafbff99d1d7b13e352e302a0cdf4aba89ff8f 100644 (file)
@@ -525,6 +525,14 @@ class AsyncTransportWrapper : virtual public AsyncTransport,
   virtual void writeChain(WriteCallback* callback,
                           std::unique_ptr<IOBuf>&& buf,
                           WriteFlags flags = WriteFlags::NONE) override = 0;
+  /**
+   * The transport wrapper may wrap another transport. This returns the
+   * transport that is wrapped. It returns nullptr if there is no wrapped
+   * transport.
+   */
+  virtual AsyncTransportWrapper* getWrappedTransport() {
+    return nullptr;
+  }
 };
 
 } // folly