SNMP alarms from client to manager

view story

http://stackoverflow.com – I am doing SNMP manager and agent programming in C using sockets in Linux. One concept called SNMP traps, for which I am not able to get the logic for it. Can anybody help me with a useful logic for getting alarm notification from SNMP agent to SNMP manager? (HowTos)