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

AsyncUDPSocket->getFD to AsyncUDPSocket->getNetworkSocket()

Summary: The file descriptor backed version will be going away.

Reviewed By: yfeldblum

Differential Revision: D14235700

fbshipit-source-id: 990b0276b085e6bb88bf3bdb83cdeba332f75ac6
parent c0fc7af5
...@@ -145,7 +145,7 @@ class AsyncUDPServerSocket : private AsyncUDPSocket::ReadCallback, ...@@ -145,7 +145,7 @@ class AsyncUDPServerSocket : private AsyncUDPSocket::ReadCallback,
int getFD() const { int getFD() const {
CHECK(socket_) << "Need to bind before getting FD"; CHECK(socket_) << "Need to bind before getting FD";
return socket_->getFD(); return socket_->getNetworkSocket().toFd();
} }
NetworkSocket getNetworkSocket() const { NetworkSocket getNetworkSocket() const {
......
...@@ -195,7 +195,7 @@ class AsyncUDPSocket : public EventHandler { ...@@ -195,7 +195,7 @@ class AsyncUDPSocket : public EventHandler {
/** /**
* Get internal FD used by this socket * Get internal FD used by this socket
*/ */
virtual int getFD() const { virtual int getFD(int) const {
return getNetworkSocket().toFd(); return getNetworkSocket().toFd();
} }
......
...@@ -312,7 +312,7 @@ class ConnectedWriteUDPClient : public UDPClient { ...@@ -312,7 +312,7 @@ class ConnectedWriteUDPClient : public UDPClient {
msg.msg_controllen = 0; msg.msg_controllen = 0;
msg.msg_flags = 0; msg.msg_flags = 0;
ssize_t ret = ::sendmsg(socket_->getFD(), &msg, 0); ssize_t ret = ::sendmsg(socket_->getNetworkSocket().toFd(), &msg, 0);
if (ret == -1) { if (ret == -1) {
if (errno != EAGAIN || errno != EWOULDBLOCK) { if (errno != EAGAIN || errno != EWOULDBLOCK) {
throw folly::AsyncSocketException( throw folly::AsyncSocketException(
......
...@@ -43,7 +43,7 @@ struct MockAsyncUDPSocket : public AsyncUDPSocket { ...@@ -43,7 +43,7 @@ struct MockAsyncUDPSocket : public AsyncUDPSocket {
MOCK_METHOD1(resumeRead, void(ReadCallback*)); MOCK_METHOD1(resumeRead, void(ReadCallback*));
MOCK_METHOD0(pauseRead, void()); MOCK_METHOD0(pauseRead, void());
MOCK_METHOD0(close, void()); MOCK_METHOD0(close, void());
MOCK_CONST_METHOD0(getFD, int()); MOCK_CONST_METHOD0(getNetworkSocket, NetworkSocket());
MOCK_METHOD1(setReusePort, void(bool)); MOCK_METHOD1(setReusePort, void(bool));
MOCK_METHOD1(setReuseAddr, void(bool)); MOCK_METHOD1(setReuseAddr, void(bool));
MOCK_METHOD1(dontFragment, void(bool)); MOCK_METHOD1(dontFragment, void(bool));
......
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