{"action":"created","issue":{"url":"https://api.github.com/repos/mcollina/mosca/issues/291","labels_url":"https://api.github.com/repos/mcollina/mosca/issues/291/labels{/name}","comments_url":"https://api.github.com/repos/mcollina/mosca/issues/291/comments","events_url":"https://api.github.com/repos/mcollina/mosca/issues/291/events","html_url":"https://github.com/mcollina/mosca/issues/291","id":92549616,"number":291,"title":"Server callback called twice","user":{"login":"arvindr21","id":2562992,"avatar_url":"https://avatars.githubusercontent.com/u/2562992?v=3","gravatar_id":"","url":"https://api.github.com/users/arvindr21","html_url":"https://github.com/arvindr21","followers_url":"https://api.github.com/users/arvindr21/followers","following_url":"https://api.github.com/users/arvindr21/following{/other_user}","gists_url":"https://api.github.com/users/arvindr21/gists{/gist_id}","starred_url":"https://api.github.com/users/arvindr21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arvindr21/subscriptions","organizations_url":"https://api.github.com/users/arvindr21/orgs","repos_url":"https://api.github.com/users/arvindr21/repos","events_url":"https://api.github.com/users/arvindr21/events{/privacy}","received_events_url":"https://api.github.com/users/arvindr21/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-02T05:08:40Z","updated_at":"2015-07-02T06:36:24Z","closed_at":null,"body":"Hello,\r\n\r\nI have the following setup \r\n\r\n```js\r\nvar mosca = require('mosca');\r\n\r\nvar settings = {\r\n    port: 2191,\r\n    persistence: mosca.persistence.Memory\r\n};\r\n\r\nvar server = new mosca.Server(settings, function() {\r\n    console.log('Mosca server is up and running 2191');\r\n});\r\n```\r\n\r\nWhen I start the server, the console log prints twice. Not sure what I am doing incorrectly. \r\n\r\nCan you please help?\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/mcollina/mosca/issues/comments/117924124","html_url":"https://github.com/mcollina/mosca/issues/291#issuecomment-117924124","issue_url":"https://api.github.com/repos/mcollina/mosca/issues/291","id":117924124,"user":{"login":"arvindr21","id":2562992,"avatar_url":"https://avatars.githubusercontent.com/u/2562992?v=3","gravatar_id":"","url":"https://api.github.com/users/arvindr21","html_url":"https://github.com/arvindr21","followers_url":"https://api.github.com/users/arvindr21/followers","following_url":"https://api.github.com/users/arvindr21/following{/other_user}","gists_url":"https://api.github.com/users/arvindr21/gists{/gist_id}","starred_url":"https://api.github.com/users/arvindr21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arvindr21/subscriptions","organizations_url":"https://api.github.com/users/arvindr21/orgs","repos_url":"https://api.github.com/users/arvindr21/repos","events_url":"https://api.github.com/users/arvindr21/events{/privacy}","received_events_url":"https://api.github.com/users/arvindr21/received_events","type":"User","site_admin":false},"created_at":"2015-07-02T06:36:24Z","updated_at":"2015-07-02T06:36:24Z","body":"Upon modifying the above like\r\n\r\n```js\r\nvar mosca = require('mosca');\r\n\r\nvar settings = {\r\n    port: 2191,\r\n    persistence: mosca.persistence.Memory\r\n};\r\n\r\nvar server = new mosca.Server(settings, function(err, srv) {\r\n   console.log(err || srv);\r\n    console.log('Mosca server is up and running 2191');\r\n});\r\n```\r\n\r\nThe response for the first time callback was `Error: is not of a type(s) object]` & the second time, it works fine.\r\n"}}