diff options
author | mcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-01-21 15:28:50 +0000 |
---|---|---|
committer | mcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-01-21 15:28:50 +0000 |
commit | 0cdb57f346af80acd7be7d283b1d03a551b54ba9 (patch) | |
tree | 72530b93e59bc6eb8e1074ba803a53364ad3c8ca /ACE/tests/Multicast_Test.cpp | |
parent | d91c4c5d399c8ee508f26f03ada184212e1c7513 (diff) | |
download | ATCD-0cdb57f346af80acd7be7d283b1d03a551b54ba9.tar.gz |
Thu Jan 21 15:25:30 UTC 2010 Martin Corino <mcorino@remedy.nl>
* tests/Multicast_Test.cpp:
Fixed a Linux specific problem where certain Linux flavors use
VERY strict rules concerning multicast communications and where
using the (system defined) defaults for the network interface
used for multicast sending/receiving does not provide a
matching setup (i.e. resulting if used for sending does not
match the if used for receiving -> nothing received).
The fix simply forces a fixed 'lo' interface to be used for
sending and receiving.
Diffstat (limited to 'ACE/tests/Multicast_Test.cpp')
-rw-r--r-- | ACE/tests/Multicast_Test.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/ACE/tests/Multicast_Test.cpp b/ACE/tests/Multicast_Test.cpp index 8aca62de09b..f3a026df86d 100644 --- a/ACE/tests/Multicast_Test.cpp +++ b/ACE/tests/Multicast_Test.cpp @@ -448,12 +448,20 @@ public: = ACE_SOCK_Dgram_Mcast::DEFOPTS); virtual ~MCT_Event_Handler (void); +#if defined (__linux__) + int join (const ACE_INET_Addr &mcast_addr, + int reuse_addr = 1, + const ACE_TCHAR *net_if = ACE_TEXT ("lo")); + int leave (const ACE_INET_Addr &mcast_addr, + const ACE_TCHAR *net_if = ACE_TEXT ("lo")); +#else int join (const ACE_INET_Addr &mcast_addr, int reuse_addr = 1, const ACE_TCHAR *net_if = 0); int leave (const ACE_INET_Addr &mcast_addr, const ACE_TCHAR *net_if = 0); - +#endif + // = Event Handler hooks. virtual int handle_input (ACE_HANDLE handle); virtual int handle_close (ACE_HANDLE fd, ACE_Reactor_Mask close_mask); @@ -779,7 +787,9 @@ int producer (MCT_Config &config) ACE_DEBUG ((LM_INFO, ACE_TEXT ("Starting producer...\n"))); ACE_SOCK_Dgram socket (ACE_sap_any_cast (ACE_INET_Addr &), PF_INET); //FUZZ: enable check_for_lack_ACE_OS - +#if defined (__linux__) + socket.set_nic ("lo"); +#endif // Note that is is IPv4 specific and needs to be changed once // if (config.ttl () > 1) |