payload: {"action":"closed","issue":{"url":"https://api.github.com/repos/danielkrainas/node-netstat/issues/23","repository_url":"https://api.github.com/repos/danielkrainas/node-netstat","labels_url":"https://api.github.com/repos/danielkrainas/node-netstat/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/danielkrainas/node-netstat/issues/23/comments","events_url":"https://api.github.com/repos/danielkrainas/node-netstat/issues/23/events","html_url":"https://github.com/danielkrainas/node-netstat/issues/23","id":425075466,"node_id":"MDU6SXNzdWU0MjUwNzU0NjY=","number":23,"title":"Handler function not being called","user":{"login":"benprofit","id":32101461,"node_id":"MDQ6VXNlcjMyMTAxNDYx","avatar_url":"https://avatars3.githubusercontent.com/u/32101461?v=4","gravatar_id":"","url":"https://api.github.com/users/benprofit","html_url":"https://github.com/benprofit","followers_url":"https://api.github.com/users/benprofit/followers","following_url":"https://api.github.com/users/benprofit/following{/other_user}","gists_url":"https://api.github.com/users/benprofit/gists{/gist_id}","starred_url":"https://api.github.com/users/benprofit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benprofit/subscriptions","organizations_url":"https://api.github.com/users/benprofit/orgs","repos_url":"https://api.github.com/users/benprofit/repos","events_url":"https://api.github.com/users/benprofit/events{/privacy}","received_events_url":"https://api.github.com/users/benprofit/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2019-03-25T19:24:11Z","updated_at":"2019-03-25T21:39:10Z","closed_at":"2019-03-25T21:39:10Z","author_association":"NONE","body":"I'm working on an existing codebase and found that the handler function is not being invoked.\r\nI checked previous issues and noticed that one said set `sync: true` but that didn't work. I'm currently running: `node-netstat: \"^1.6.0\"` and trying to use it to close a standalone Selenium Server running a webdriver on port 4444 locally. Code snippet below. Greatly appreciate any advice on ways to fix/refactor. 🙏 \r\n\r\n    const netstat = require('node-netstat');\r\n    const fkill = require('fkill');\r\n\r\n    async function getStopWdPromise() {\r\n        return await new Promise((resolve, reject) => {\r\n            netstat({\r\n                sync: true,\r\n                filter: {\r\n                    protocol: 'tcp',\r\n                    local: {port: 4444, address: null}\r\n                },\r\n                limit: 1,\r\n                done: function (error) {\r\n                   console.log(error) // this gets logged error = null\r\n            }\r\n            }, function (data) {\r\n                console.log(data) // everything in this function does not get logged\r\n                console.log(`Killing WebDriver process with pid ${data.pid}`);\r\n                fkill(data.pid, {force: true});\r\n                setTimeout(function () { console.log('Killed WebDriver process') }, 5000);\r\n                resolve();\r\n            });\r\n        });\r\n    }"}}
other: {"actor":{"display_login":"benprofit"}}