문제

I tried to run hook.io with a different port, which killed the autodiscover features of the clients. But when I try to create the clients with the same port, they get an error.

Sever:

var oHook = hookio.createHook( {
  'name'     :'dispatch-hook',
  'hook-port': 9999,
  'hook-host': 'localhost'
} );

oHook.start();

Client:

var oHook = hookio.createHook( {
  name       :'client-hook',
  "hook-port":9999,
  "hook-host":'localhost'
});

oHook.connect();

Error:

events.js:66
    throw arguments[1]; // Unhandled 'error' event
                   ^
Error: listen EADDRINUSE
    at errnoException (net.js:781:11)
    at Server._listen2._connectionKey (net.js:922:26)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)

Why does the client want to start a server?

도움이 되었습니까?

해결책

You shouldn't provide a port for the hook trying to connect to the server hook. The existence of hook-port in options makes that hook a server

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top