zpl-c / enet

⚡️ ENet reliable UDP networking library

Home Page:https://blog.zpl.pw

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ENET_HOST_ANY

wpbirney opened this issue · comments

using ENET_HOST_ANY, makes enet listen on the ipv6 device if available ( at least on linux )
this isn't a problem but i was wondering if there is a ENET_HOST_ANY_ variant that forces ipv4

I dont see one in the source, but i figure i could add it quite easily

*edit
further digging seems that ENetAddress expects an in6addr and seems to only support ipv6 now

Currently there is no way to force listen to ipv4 only via ENET_HOST_ANY directive from what I know. However, ENet should support both ipv4 and ipv6, not just ipv6.

Have you tried binding the ipv4 address, and check wether it's gonna listen to ipv4 only? The usual address for listen-all on ipv4 is 0.0.0.0

further digging seems that ENetAddress expects an in6addr and seems to only support ipv6 now

IPv4 supported via IPv4-mapped IPv6 address.

@inlife attempting to bind to 0.0.0.0 still had it listening on 'udp6' according to netstat.
I will look into doing it via a ipv4-mapped ipv6 address. Hopefully soon everyone will have a public ipv6 address, I only have two players that have complained about the ipv4 issue