Closed foooooouny closed 6 years ago
You have something running on your system on port 1883.
nothing,and if I changed this port,the same problem will arise.
Look.
mosca is ready
2017-11-16 21:33:00,381 ERROR 39232 nodejs.unhandledExceptionError: listen EADDRINUSE 127.0.0.1:1898
at Object._errnoException (util.js:1041:11)
at _exceptionWithHostPort (util.js:1064:20)
at Server.setupListenHandle [as _listen2] (net.js:1322:14)
at listenInCluster (net.js:1370:12)
at GetAddrInfoReqWrap.doListen [as callback] (net.js:1492:7)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:100:10)
code: 'EADDRINUSE'
errno: 'EADDRINUSE'
syscall: 'listen'
address: '127.0.0.1'
port: 1898
name: 'unhandledExceptionError'
pid: 39232
hostname: zzboydeMBP
are you using cluster?
yep,and my server is using egg.js
config.cluster = {
listen: {
port: 7004,
hostname: '0.0.0.0',
// path: '/var/run/egg.sock',
},
};
does it work without cluster and egg?
eh...Have not tried.
if used cluster will have this question?
I don't know really, I typically deploy this on servers with a single CPU.
eh.....Okey.I'm trying something else,Thx vary mush.
// init mosca mqtt const server = new mosca.Server(settings);
My local Mosca boker is running,and not other Service process used 1883 port.Just local boker.If I killer it,the same problem will arise. but! Mosca events of 'ready' always is ok.