Package capturer, storer, and forwarder

Purpose

Capture UDP sent SNMP Traps, and forward them to a destination.

A requirement was that it had to be guaranteed that the Traps were delivered to the destination.

A way to achieve that guarantee was to write them to local storage, so they would not be lost, and to keep track of them by the sender informing the destination that it was about to send a trap with an id of the trap.
The solution had a sender\receiver architecture where the sender and receiver would establish a TCP socket between them. The socket was for the communication of what was being sent and when, as well as a mechanism to determine a communication link was open between sender and receiver.