One of the interesting things about most examples predicated on use of boost::asio::ip:udp (or ip::tcp) is the callback handlers has logic embedded within them, therefore the class is not reusable. My requirement surrounds the design of a reusable UDP class using boost::asio.
- Reusable UDP class must support multicast and non-multicast transactions.
- Reusable UDP class must support asynchronous operations (async_write and async_read ) with a separate client and server class for each. NOTE: there could be a base class (connection) but I need separate classes for client and server transactions
- Reusable UDP class must accept a callback handler – which get invoked once an asynchronous operation is complete
- Reusable UDP class must allow the user to enter number of thread (thread pool)
- Reusable UDP class must detect multicast from the address range
NOTE: This is NOT a hard requirement but an example I’d like to mimic is based on use of cpp-netlib ([login to view URL]) . Meaning when view from a ‘pseudo code’ perspective the pseudo code might be akin to what’s shown in the attached file.
Miscellaneous
a) You must send me a pseudo code so I could view a ‘skeleton’ prior to accepting your bid
b) Code should have no tabs
c) Code should use 2 spaces
d) Code should execute on Linux/Windows
e) The latest boost version will suffice