Skip to content

Removing Trap Listener #260

@irfancnk

Description

@irfancnk

I am using following for my NodeJS server,

const snmpTrap = require('snmpjs');
var log = new bunyan({ name: 'snmpd', level: 'trace'});
var trapd = snmpTrap.createTrapListener({log: log});
trapd.bind(options);
trapd.on('trap',function(msg) {
    handleTrap(msg);
});

However, when I try graceful shutdown the Node server, I got the port 162 INUSE error, which is because of the absence of removeListener method. So is there a way to gracefully shutdown the snmpTrap listener?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions