face: Switching to 2 sockets in MulticastUdpFace for sending and receiving
To send over UDP multicast, we should not bind to multicast address.
This is true at least on OSX 10.9, which generates "Can't assign
requested address" error (error code: 49). However, without binding to
the multicast address, the socket may receive unnecessary unrelated
packets. To solve this problem, this commit splits sending and
receiving into two sockets, one for sending and one for receiving.
Change-Id: Ibce05c7071fd683a26b3c88cd2a168546c5dc605
Refs: #1668
diff --git a/daemon/face/multicast-udp-face.hpp b/daemon/face/multicast-udp-face.hpp
index 743cf56..0ac857e 100644
--- a/daemon/face/multicast-udp-face.hpp
+++ b/daemon/face/multicast-udp-face.hpp
@@ -40,8 +40,10 @@
/**
* \brief Creates a UDP-based face for multicast communication
*/
- MulticastUdpFace(const shared_ptr<protocol::socket>& socket,
- const protocol::endpoint& localEndpoint);
+ MulticastUdpFace(const shared_ptr<protocol::socket>& recvSocket,
+ const shared_ptr<protocol::socket>& sendSocket,
+ const protocol::endpoint& localEndpoint,
+ const protocol::endpoint& multicastEndpoint);
const protocol::endpoint&
getMulticastGroup() const;
@@ -62,6 +64,7 @@
private:
protocol::endpoint m_multicastGroup;
+ shared_ptr<protocol::socket> m_sendSocket;
};
} // namespace nfd