[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Checking refusal of a network connection

On 06/01/2019 11:15 AM, Markus Elfring wrote:
>>> connect(3, {sa_family=AF_INET, sin_port=htons(37351), sin_addr=inet_addr("")}, 16) = -1 ECONNREFUSED (Connection refused)
>> 	Without seeing the code, I'd be suspicious of that difference.
> I would expect that the IPv4 address from such a connection attempt
> would be automatically converted to a IPv6 loopback address.

How would this conversion take place?  Localhost is
Localhost6 is ::1.  They are different and you cannot route between the two.

What I can see is that your server binds to localhost6 and your client
is trying to connect to localhost.

> Unfortunately, the direct specification ?? --server_id ::1 ??
> does not work at the moment because of the error message ?socket.gaierror: [Errno -9]
> Address family for hostname not supported?.

No idea on that one.