Commit efe97b16 authored by Orvid King's avatar Orvid King Committed by Facebook Github Bot

AsyncSocket.getFd to AsyncSocket.getNetworkSocket

Reviewed By: yfeldblum

Differential Revision: D13603396

fbshipit-source-id: 90d2ce9e4d3cfc681e27df84e8e989c7cee182cc
parent ef56dd79
......@@ -573,7 +573,7 @@ void AsyncSSLSocket::switchServerSSLContext(
// We log it here and allow the switch.
// It should not affect our re-negotiation support (which
// is not supported now).
VLOG(6) << "fd=" << getFd()
VLOG(6) << "fd=" << getNetworkSocket().toFd()
<< " renegotation detected when switching SSL_CTX";
}
......
......@@ -216,12 +216,13 @@ class WriteCheckTimestampCallback : public WriteCallbackBase {
SOF_TIMESTAMPING_SOFTWARE;
AsyncSocket::OptionKey tstampingOpt = {SOL_SOCKET, SO_TIMESTAMPING};
int ret = tstampingOpt.apply(
folly::NetworkSocket::fromFd(socket_->getFd()), flags);
folly::NetworkSocket::fromFd(socket_->getNetworkSocket().toFd()),
flags);
EXPECT_EQ(ret, 0);
}
void checkForTimestampNotifications() noexcept {
int fd = socket_->getFd();
int fd = socket_->getNetworkSocket().toFd();
std::vector<char> ctrl(1024, 0);
unsigned char data;
struct msghdr msg;
......@@ -429,7 +430,7 @@ class WriteErrorCallback : public ReadCallback {
currentBuffer.length = len;
// close the socket before writing to trigger writeError().
::close(socket_->getFd());
::close(socket_->getNetworkSocket().toFd());
wcb_->setSocket(socket_);
......@@ -583,7 +584,7 @@ class SSLServerAcceptCallbackDelay : public SSLServerAcceptCallback {
auto sock = std::static_pointer_cast<AsyncSSLSocket>(s);
std::cerr << "SSLServerAcceptCallbackDelay::connAccepted" << std::endl;
int fd = sock->getFd();
int fd = sock->getNetworkSocket().toFd();
#ifndef TCP_NOPUSH
{
......
......@@ -33,8 +33,8 @@ TEST(AsyncSocketTest, getSockOpt) {
int val;
socklen_t len;
int expectedRc =
getsockopt(socket->getFd(), SOL_SOCKET, SO_REUSEADDR, &val, &len);
int expectedRc = getsockopt(
socket->getNetworkSocket().toFd(), SOL_SOCKET, SO_REUSEADDR, &val, &len);
int actualRc = socket->getSockOpt(SOL_SOCKET, SO_REUSEADDR, &val, &len);
EXPECT_EQ(expectedRc, actualRc);
......
......@@ -1970,7 +1970,7 @@ TEST(AsyncSocketTest, DestroyCloseTest) {
WriteCallback wcb;
// Let the reads and writes run to completion
int fd = acceptedSocket->getFd();
int fd = acceptedSocket->getNetworkSocket().toFd();
acceptedSocket->write(&wcb, simpleBuf, simpleBufLength);
socket.reset();
......@@ -3077,7 +3077,7 @@ TEST(AsyncSocketTest, ErrMessageCallback) {
ConnCallback ccb;
socket->connect(&ccb, server.getAddress(), 30);
LOG(INFO) << "Client socket fd=" << socket->getFd();
LOG(INFO) << "Client socket fd=" << socket->getNetworkSocket().toFd();
// Let the socket
evb.loop();
......
......@@ -87,7 +87,7 @@ class BlockingSocket : public folly::AsyncSocket::ConnectCallback,
}
int getSocketFD() const {
return sock_->getFd();
return sock_->getNetworkSocket().toFd();
}
folly::AsyncSocket* getSocket() {
......
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