k0001 / network-simple

Haskell library abstracting common network sockets usage patterns.
BSD 3-Clause "New" or "Revised" License
33 stars 9 forks source link

I implemented a very primitive version of RFC6555 for dealing with ipv6 and ipv4. #15

Closed pharaun closed 6 years ago

pharaun commented 9 years ago

For context pharaun/Karmator#115 there was a problem in that the library was only grabbing the first resolved ip address from the dns query. However if the connection failed or was extremely slow it would stall/throw an error that I couldn't handle without doing the connection manually.

I implemented a very simple version of RFC6555 (happy eyeball) in which I will attempt to connect to an ipv6 address first, and if that fails, connect to a ipv4 address then alternate with each others till either one of them work (within 1s) or we run out of addresses.

The commit is: pharaun/network-simple@9c2544be44398f589864ebc552f9785d475b5332

If there is any interest in this, I'll be more than happy to try to clean it up and tender a pull-request. My main worry is I'm not using the timeout/catch semantics properly at all. Also I suspect that there may be issues on windows (iirc the network stuff are un-interruptable).

k0001 commented 9 years ago

@pharaun thanks. I wasn't aware of the Happy Eyeball recommendation. I'll test this a bit, clean it up if needed, and then merge it. Thank you.

k0001 commented 8 years ago

I am so sorry, I completely forgot about this issue! It's been such a long time. I'll get down to it and have it released this week.

k0001 commented 6 years ago

This has been implemented already. Thanks. Sorry for the incredibly long delay.