Skip to content

Removing Trap Listener #260

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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