Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on connect for sub socket #143

Open
adicirstei opened this issue Apr 16, 2015 · 4 comments
Open

Error on connect for sub socket #143

adicirstei opened this issue Apr 16, 2015 · 4 comments

Comments

@adicirstei
Copy link

Hi, I tried the code sample in the README for pub/sub sockets and got the EADDRNOTAVAIL error. Any Idea why this is happening? I am using a windows 7 64 bits machine with node 0.12.2 for the last test. I also got the same error on node 0.10.38 but only once a then the process died.
I ran this in the node REPL. The pub part was working just fine in a different REPL, no error occured (just to know that I didn't forgot that part).

> var a = require('axon')
undefined
> var s = a.socket('sub')
undefined
> s.connect(3003)
{ opts: {},
  server: null,
  socks: [],
  settings:
   { hwm: Infinity,
     identity: '120752',
     'retry timeout': 100,
     'retry max timeout': 5000 },
  subscriptions: [],
  type: 'client' }
> Error: connect EADDRNOTAVAIL
    at exports._errnoException (util.js:746:11)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1000:19)
> Error: connect EADDRNOTAVAIL
    at exports._errnoException (util.js:746:11)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1000:19)
@adicirstei adicirstei changed the title Error on connect for sub socket Error on connect for sub socket Apr 16, 2015
@jcrugzz
Copy link
Collaborator

jcrugzz commented Apr 16, 2015

@adicirstei does this still happen on 0.10.x? Something may have changed in 0.12.x/iojs that need to be handled or there is a bug in 0.12.x. Could you test this in a script independent of the repl and post the code in a gist that reproduces this issue? Thanks!

@adicirstei
Copy link
Author

I did this on node v0.10.38:

image

The gist contain just the README code:
https://gist.github.com/adicirstei/1cd7d4888a91c39a466b

It doesn't matter if I'm running 32 or 64 bit versions of node. The outcome is the same. Also, please note that I am using the axon v2.0.1. I'll try an older one.

@adicirstei
Copy link
Author

Good news!

If I connect on a specific address it is working just fine. The bind part stayed the same.

  sock.connect(3000, '127.0.0.1');

Maybe on windows, trying to connect to '0.0.0.0' is not such a good idea.

@jonathanrdelgado
Copy link

@adicirstei You saved me some troubleshooting with that fix, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants