/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2014-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Destructor());
}
- void setShutdownSocketSet(ShutdownSocketSet* newSS);
+ void setShutdownSocketSet(const std::weak_ptr<ShutdownSocketSet>& wNewSS);
/**
* Destroy the socket.
}
}
+ /* enable zerocopy support for the server sockets - the s = accept sockets
+ * inherit it
+ */
+ bool setZeroCopy(bool enable);
+
/**
* Bind to the specified address.
*
* socket's primary EventBase.
*/
int64_t getNumPendingMessagesInQueue() const {
- assert(eventBase_ == nullptr || eventBase_->isInEventBaseThread());
+ if (eventBase_) {
+ eventBase_->dcheckIsInEventBaseThread();
+ }
int64_t numMsgs = 0;
for (const auto& callback : callbacks_) {
numMsgs += callback.consumer->getQueue()->size();
*/
class RemoteAcceptor
: private NotificationQueue<QueueMessage>::Consumer {
- public:
+ public:
explicit RemoteAcceptor(AcceptCallback *callback,
ConnectionEventCallback *connectionEventCallback)
: callback_(callback),
return &queue_;
}
- private:
+ private:
AcceptCallback *callback_;
ConnectionEventCallback* connectionEventCallback_;
bool tfo_{false};
bool noTransparentTls_{false};
uint32_t tfoMaxQueueSize_{0};
- ShutdownSocketSet* shutdownSocketSet_;
+ std::weak_ptr<ShutdownSocketSet> wShutdownSocketSet_;
ConnectionEventCallback* connectionEventCallback_{nullptr};
};
-} // folly
+} // namespace folly