1

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?

daotoad
  • 26,689
  • 7
  • 59
  • 100
K..
  • 4,044
  • 6
  • 40
  • 85

1 Answers1

1

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

Pavan Kumar Sunkara
  • 3,025
  • 21
  • 30
  • Thank you. I thought about that, but without `hook-port` the client gets no connection. Only if the server runs on port `5000`. – K.. Jul 03 '12 at 09:00