Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top