Hi!
I was writing a TCP client application, which does getaddrinfo and
attempts to connect to the result addresses until it succeeds. There is
no server at the other end, so I expected all attempts to fail. However,
while the first attempt fails with ECONNREFUSED, the next one fails with
EINVAL, which was a bit surprising to me.
I tracked it down to the very connect() syscall, it returns EINVAL. Is
this expected? This was on OSX, FWIW.
Here [0] is a test script written with pyuv, I can translate it to C if
needed, but it was easier for me to test in Python ;-)
Am I doing something terribly wrong here?
Thanks!
[0]:
https://gist.github.com/saghul/5476393
--
Sa�l Ibarra Corretg�
http://about.me/saghul |
http://saghul.net