Commit 22f86ef7 authored by Mohammad Husain's avatar Mohammad Husain Committed by facebook-github-bot-1

Rename two callback function names of ConnectionEventCallback

Summary: Renaming `EnqueuedForAccept` and `DequeuedByAccept` to
`EnqueuedForAcceptor` and `DequeuedByAcceptor` respectively to make it clear
that the connection is queued for the Acceptor not to call `accept` on.

Reviewed By: yfeldblum

Differential Revision: D2554578

fb-gh-sync-id: 072a9ff122658827d1e89f2bef79ad565dad7974
parent 209397bd
......@@ -92,7 +92,7 @@ void AsyncServerSocket::RemoteAcceptor::messageAvailable(
case MessageType::MSG_NEW_CONN:
{
if (connectionEventCallback_) {
connectionEventCallback_->onConnectionDequeuedByAcceptCallback(
connectionEventCallback_->onConnectionDequeuedByAcceptorCallback(
msg.fd, msg.address);
}
callback_->connectionAccepted(msg.fd, msg.address);
......@@ -824,8 +824,9 @@ void AsyncServerSocket::dispatchSocket(int socket,
while (true) {
if (info->consumer->getQueue()->tryPutMessageNoThrow(std::move(msg))) {
if (connectionEventCallback_) {
connectionEventCallback_->onConnectionEnqueuedForAcceptCallback(socket,
addr);
connectionEventCallback_->onConnectionEnqueuedForAcceptorCallback(
socket,
addr);
}
// Success! return.
return;
......
......@@ -95,18 +95,18 @@ class AsyncServerSocket : public DelayedDestruction
const SocketAddress& addr) noexcept = 0;
/**
* onConnectionEnqueuedForAcceptCallback() is called when the
* onConnectionEnqueuedForAcceptorCallback() is called when the
* connection is successfully enqueued for an AcceptCallback to pick up.
*/
virtual void onConnectionEnqueuedForAcceptCallback(
virtual void onConnectionEnqueuedForAcceptorCallback(
const int socket,
const SocketAddress& addr) noexcept = 0;
/**
* onConnectionDequeuedByAcceptCallback() is called when the
* onConnectionDequeuedByAcceptorCallback() is called when the
* connection is successfully dequeued by an AcceptCallback.
*/
virtual void onConnectionDequeuedByAcceptCallback(
virtual void onConnectionDequeuedByAcceptorCallback(
const int socket,
const SocketAddress& addr) noexcept = 0;
......
......@@ -1480,14 +1480,14 @@ class TestConnectionEventCallback :
connectionDropped_++;
}
virtual void onConnectionEnqueuedForAcceptCallback(
virtual void onConnectionEnqueuedForAcceptorCallback(
const int socket,
const SocketAddress& addr) noexcept override {
folly::RWSpinLock::WriteHolder holder(spinLock_);
connectionEnqueuedForAcceptCallback_++;
}
virtual void onConnectionDequeuedByAcceptCallback(
virtual void onConnectionDequeuedByAcceptorCallback(
const int socket,
const SocketAddress& addr) noexcept override {
folly::RWSpinLock::WriteHolder holder(spinLock_);
......
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