#include <limits>
#include <fmt/core.h>
#include "AsyncFdSocket.h"
namespace folly {
AsyncFdSocket::AsyncFdSocket(EventBase* evb)
: … { … }
#else
{
}
#endif
AsyncFdSocket::AsyncFdSocket(
EventBase* evb,
const folly::SocketAddress& address,
uint32_t connectTimeout)
: … { … }
AsyncFdSocket::AsyncFdSocket(
EventBase* evb, NetworkSocket fd, const folly::SocketAddress* peerAddress)
: … { … }
#else
{
}
#endif
AsyncFdSocket::AsyncFdSocket(
AsyncFdSocket::DoesNotMoveFdSocketState, AsyncSocket* sock)
: … { … }
#else
{
}
#endif
AsyncFdSocket::AsyncFdSocket(
AsyncFdSocket::DoesNotMoveFdSocketState tag, AsyncSocket::UniquePtr sock)
: … { … }
void AsyncFdSocket::writeChainWithFds(
WriteCallback* callback,
std::unique_ptr<folly::IOBuf> buf,
SocketFds socketFds,
WriteFlags flags) { … }
#if !defined(_WIN32)
void AsyncFdSocket::setUpCallbacks() noexcept { … }
void AsyncFdSocket::swapFdReadStateWith(AsyncFdSocket* other) { … }
void AsyncFdSocket::releaseIOBuf(
std::unique_ptr<folly::IOBuf> buf, ReleaseIOBufCallback* callback) { … }
std::pair<
size_t,
AsyncFdSocket::FdSendMsgParamsCallback::WriteTagToFds::iterator>
AsyncFdSocket::FdSendMsgParamsCallback::getCmsgSizeAndFds(
const AsyncSocket::WriteRequestTag& writeTag) noexcept { … }
void AsyncFdSocket::FdSendMsgParamsCallback::getAncillaryData(
folly::WriteFlags,
void* data,
const WriteRequestTag& writeTag,
const bool ) noexcept { … }
uint32_t AsyncFdSocket::FdSendMsgParamsCallback::getAncillaryDataSize(
folly::WriteFlags,
const WriteRequestTag& writeTag,
const bool ) noexcept { … }
void AsyncFdSocket::FdSendMsgParamsCallback::wroteBytes(
const WriteRequestTag& writeTag) noexcept { … }
bool AsyncFdSocket::FdSendMsgParamsCallback::registerFdsForWriteTag(
WriteRequestTag writeTag, SocketFds::ToSend&& fds) { … }
void AsyncFdSocket::FdSendMsgParamsCallback::destroyFdsForWriteTag(
WriteRequestTag writeTag) noexcept { … }
namespace {
bool receiveFdsFromCMSG(
const struct ::cmsghdr& cmsg, std::vector<folly::File>* fds) noexcept { … }
bool receiveFds(struct ::msghdr& msg, std::vector<folly::File>* fds) noexcept { … }
}
void AsyncFdSocket::enqueueFdsFromAncillaryData(struct ::msghdr& msg) noexcept { … }
SocketFds::SeqNum AsyncFdSocket::addSeqNum(
SocketFds::SeqNum a, SocketFds::SeqNum b) noexcept { … }
#endif
SocketFds AsyncFdSocket::popNextReceivedFds() { … }
SocketFds::SeqNum AsyncFdSocket::injectSocketSeqNumIntoFdsToSend(
SocketFds* fds) { … }
}