TrapAgent class is used to hide Socket operations from users and provide an easy method to send Trap notifications. To use the class, you can use the TrapAgent class protocol specific members, recommended when you expect to send a lot of notifications, or a static helper TrapAgent.SendTrap method which will construct a new socket for each call.