This sample shows how to use multiple NW channel implementations in an application. The master application creates and populates the database, then enters a loop creating and deleting the objects as it waits for connection requests from replicas both via TCP and UDP channels. The
hamultichan_rpltcp
application connects to "master" via the TCP channel and synchronizes with its database. Similarly,hamultichan_rpludp
connects to "master" using the UDP channel.
See instructions here on how to build this and other samples on your development platform. Once built, the sample can be run from the
\target\bin
directory.In a console window run:
hamultichan_masterThen run one or several TCP replica applications:
hamultichan_rpltcpNow run a UDP replica:
hamultichan_rpludpBut it is more instructive to run one instance in your development environment debugger, stepping through the code.