Commit 45cd2ae5 authored by Dan Melnic's avatar Dan Melnic Committed by Facebook GitHub Bot

Add the ability to set the event EventRecvmsgCallback

Summary: Add the ability to set the event EventRecvmsgCallback

Reviewed By: danobi

Differential Revision: D22959687

fbshipit-source-id: 274cecf4ab4b8015d5e7e725c7e899f603cea7a0
parent e7e80abf
...@@ -503,6 +503,13 @@ class AsyncSocket : public AsyncTransport { ...@@ -503,6 +503,13 @@ class AsyncSocket : public AsyncTransport {
// Read and write methods // Read and write methods
void setReadCB(ReadCallback* callback) override; void setReadCB(ReadCallback* callback) override;
ReadCallback* getReadCallback() const override; ReadCallback* getReadCallback() const override;
void setEventCallback(EventRecvmsgCallback* cb) override {
if (cb) {
ioHandler_.setEventCallback(cb);
} else {
ioHandler_.resetEventCallback();
}
}
bool setZeroCopy(bool enable) override; bool setZeroCopy(bool enable) override;
bool getZeroCopy() const override { bool getZeroCopy() const override {
......
...@@ -266,6 +266,7 @@ class AsyncReader { ...@@ -266,6 +266,7 @@ class AsyncReader {
// Read methods that aren't part of AsyncTransport. // Read methods that aren't part of AsyncTransport.
virtual void setReadCB(ReadCallback* callback) = 0; virtual void setReadCB(ReadCallback* callback) = 0;
virtual ReadCallback* getReadCallback() const = 0; virtual ReadCallback* getReadCallback() const = 0;
virtual void setEventCallback(EventRecvmsgCallback* /*cb*/) {}
protected: protected:
virtual ~AsyncReader() = default; virtual ~AsyncReader() = default;
......
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