[Ace-users] [ace-users] [PATCH] Deprecated ACE_SOCK_Dgram_Mcast::unsubscribe (void)

Douglas C. Schmidt schmidt at dre.vanderbilt.edu
Wed Nov 21 07:08:53 CST 2007


Hi Stefan,

   Can you please provide a ChangeLog entry for this patch that
   explains what it's purpose is?
   
   thanks,
   
   Doug

>Here's a trivial patch (against Rev.73737) for
>$ACE_ROOT/examples/Reactor/Ntalker/ntalker.cpp.
>
>Regards,
>     Stefan
>-- 
>----------------------------------------------------------------
>Dipl.-Inform. Stefan Naewe                 ATLAS Elektronik GmbH
>                                                   Dept.: NUS T4
>phone: +49-(0)421-457-1378          Sebaldsbruecker Heerstr. 235
>fax:   +49-(0)421-457-3913                          28305 Bremen
>----------------------------------------------------------------
>/dev/random says: Would I ask you a rhetorical question?
>
>--------------000705000101090508010309
>Content-Type: text/plain;
> name="ntalker.cpp.diff"
>Content-Transfer-Encoding: 7bit
>Content-Disposition: inline;
> filename="ntalker.cpp.diff"
>
>--- /home/naewe/ntalker.cpp.TRUNK	2007-11-20 12:00:50.000000000 +0100
>+++ ntalker.cpp	2007-11-20 11:58:26.000000000 +0100
>@@ -1,4 +1,4 @@
>-// $Id$
>+// $Id: ntalker.cpp 54959 2003-12-30 23:18:59Z shuston $
> 
> // Listens to multicast address.  After first message received, will
> // listen for 5 more seconds.  Prints Mbits/sec received from client.
>@@ -12,7 +12,7 @@
> #include "ace/Thread_Manager.h"
> #include "ace/Service_Config.h"
> 
>-ACE_RCSID(Ntalker, ntalker, "$Id$")
>+ACE_RCSID(Ntalker, ntalker, "$Id: ntalker.cpp 54959 2003-12-30 23:18:59Z shuston $")
> 
> #if defined (ACE_HAS_IP_MULTICAST)
> // Network interface to subscribe to.  This is hardware specific.  use
>@@ -45,6 +45,7 @@
> 
> private:
>   ACE_SOCK_Dgram_Mcast mcast_;
>+  ACE_INET_Addr  sockmc_addr_;
>   // Multicast wrapper.
> };
> 
>@@ -134,7 +135,7 @@
> 
> Handler::~Handler (void)
> {
>-  if (this->mcast_.unsubscribe () == -1)
>+  if (this->mcast_.leave (sockmc_addr_) == -1)
>     ACE_ERROR ((LM_ERROR,
>                 "%p\n",
>                 "unsubscribe fails"));
>@@ -147,11 +148,11 @@
> {
>   // Create multicast address to listen on.
> 
>-  ACE_INET_Addr sockmc_addr (udp_port, ip_addr);
>+  sockmc_addr_ = ACE_INET_Addr (udp_port, ip_addr);
> 
>   // subscribe to multicast group.
> 
>-  if (this->mcast_.subscribe (sockmc_addr, 1, a_interface) == -1)
>+  if (this->mcast_.subscribe (sockmc_addr_, 1, a_interface) == -1)
>   {
>   	  ACE_ERROR ((LM_ERROR,
>                 "%p\n",
>
>--------------000705000101090508010309--
>


-- 
Dr. Douglas C. Schmidt                       Professor and Associate Chair
Electrical Engineering and Computer Science  TEL: (615) 343-8197
Vanderbilt University                        WEB: www.dre.vanderbilt.edu/~schmidt
Nashville, TN 37203                          NET: d.schmidt at vanderbilt.edu



More information about the Ace-users mailing list