Commit d58678d6 authored by Fred Emmott's avatar Fred Emmott Committed by Facebook Github Bot

Revert D13966702: [fbcode] AsyncServerSocket::AcceptCallback::connectionAccepted to NetworkSocket

Differential Revision:
D13966702

Original commit changeset: 415622dc347d

fbshipit-source-id: 11ff9cac08174cfaefe20e7e4c5e08dc005aaa39
parent 9688659c
...@@ -158,8 +158,13 @@ class AsyncServerSocket : public DelayedDestruction, public AsyncSocketBase { ...@@ -158,8 +158,13 @@ class AsyncServerSocket : public DelayedDestruction, public AsyncSocketBase {
* remain valid until connectionAccepted() returns. * remain valid until connectionAccepted() returns.
*/ */
virtual void connectionAccepted( virtual void connectionAccepted(
NetworkSocket fd, int fd,
const SocketAddress& clientAddr) noexcept = 0; const SocketAddress& clientAddr) noexcept = 0;
void connectionAccepted(
NetworkSocket fd,
const SocketAddress& clientAddr) noexcept {
connectionAccepted(fd.toFd(), clientAddr);
}
/** /**
* acceptError() is called if an error occurs while accepting. * acceptError() is called if an error occurs while accepting.
......
...@@ -182,12 +182,12 @@ class TestAcceptCallback : public AsyncServerSocket::AcceptCallback { ...@@ -182,12 +182,12 @@ class TestAcceptCallback : public AsyncServerSocket::AcceptCallback {
} }
void connectionAccepted( void connectionAccepted(
NetworkSocket fd, int fd,
const folly::SocketAddress& clientAddr) noexcept override { const folly::SocketAddress& clientAddr) noexcept override {
events_.emplace_back(fd, clientAddr); events_.emplace_back(NetworkSocket::fromFd(fd), clientAddr);
if (connectionAcceptedFn_) { if (connectionAcceptedFn_) {
connectionAcceptedFn_(fd, clientAddr); connectionAcceptedFn_(NetworkSocket::fromFd(fd), clientAddr);
} }
} }
void acceptError(const std::exception& ex) noexcept override { void acceptError(const std::exception& ex) noexcept override {
......
...@@ -61,10 +61,8 @@ class SSLServerAcceptCallbackBase : public AsyncServerSocket::AcceptCallback { ...@@ -61,10 +61,8 @@ class SSLServerAcceptCallbackBase : public AsyncServerSocket::AcceptCallback {
} }
void connectionAccepted( void connectionAccepted(
folly::NetworkSocket fdNetworkSocket, int fd,
const SocketAddress& /* clientAddr */) noexcept override { const SocketAddress& /* clientAddr */) noexcept override {
int fd = fdNetworkSocket.toFd();
if (socket_) { if (socket_) {
socket_->detachEventBase(); socket_->detachEventBase();
} }
......
...@@ -227,10 +227,8 @@ class ZeroCopyTestServer : public folly::AsyncServerSocket::AcceptCallback { ...@@ -227,10 +227,8 @@ class ZeroCopyTestServer : public folly::AsyncServerSocket::AcceptCallback {
} }
void connectionAccepted( void connectionAccepted(
folly::NetworkSocket fdNetworkSocket, int fd,
const folly::SocketAddress& /* unused */) noexcept override { const folly::SocketAddress& /* unused */) noexcept override {
int fd = fdNetworkSocket.toFd();
auto client = std::make_shared<ZeroCopyTestAsyncSocket>( auto client = std::make_shared<ZeroCopyTestAsyncSocket>(
nullptr, evb_, fd, numLoops_, bufferSize_, zeroCopy_); nullptr, evb_, fd, numLoops_, bufferSize_, zeroCopy_);
clients_[client.get()] = client; clients_[client.get()] = client;
......
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