[Ace-users] [ace-users] ACE_SOCK_Dgram_Bcast to find server
Douglas C. Schmidt
schmidt at dre.vanderbilt.edu
Wed Nov 7 19:16:55 CST 2007
Hi Robert,
To ensure that we have proper version/platform/compiler information,
please make sure you fill out the appropriate problem report form (PRF),
which is in
$ACE_ROOT/PROBLEM-REPORT-FORM
$TAO_ROOT/PROBLEM-REPORT-FORM
or in
$ACE_ROOT/BUG-REPORT-FORM
$TAO_ROOT/BUG-REPORT-FORM
in older versions of ACE+TAO. Make sure to include this information
when asking any questions about ACE+TAO since otherwise we have to
"guess" what version/platform/compiler/options you've using, which is
very error-prone and slows down our responsiveness. If you don't use
the PRF, therefore, it is less likely that someone from the core
ACE+TAO developer team will be able to answer your question.
Naturally, we encourage and appreciate other members of the ACE+TAO
user community who can respond to questions that they have the answers
to.
> I am trying to use ACE_SOCK_Dgram_Bcast to find a server device. The server responds to the broadcast on my local port
> that I sent in the broadcast message. I try to use the same instance of ACE_SOCK_Dgram_Bcast to receive the response but
> it does not work.
>
> I know that if the server responded on a different port than the one I sent, I could use another ACE_SOCK_Dgram opened on
> that port and read the response. But I can't create another ACE_SOCK_Dgram to read the same local port that the
> ACE_SOCK_Dgram_Bcast already has open.
>
> It seems natural to use the ACE_SOCK_Dgram_Bcast to tell the server what port to respond on. What is the trick?
There are examples of ACE_SOCK_Dgram_Bcast in
ACE_ROOT/tests/SOCK_Dgram_Bcast_Test.cpp
ACE_ROOT/APG/Misc_IPC/UDP_Broadcast.cpp
There are also examples of ACE_SOCK_Dgram_Mcast that might be relevant,
as well, in
ACE_ROOT/examples/Reactor/Multicast
ACE_ROOT/examples/Reactor/Ntalker
Finally, TAO has a service that uses multicast to do basically what
you're trying to achieve. Please see
TAO/orbsvcs/orbsvcs/IOR_Multicast.h
TAO/orbsvcs/orbsvcs/IOR_Multicast.cpp
for details.
Thanks,
Doug
More information about the Ace-users
mailing list