audreyt / network-multicast

[Haskell] The "Network.Multicast" module is for sending UDP datagrams over multicast (class D) addresses.
http://github.com/audreyt/network-multicast
Other
23 stars 12 forks source link

Add ipv6 support #18

Closed lsix closed 5 years ago

lsix commented 5 years ago

This PR is still WIP at the moment, but any comments on the work being done are welcome. This code have only been tested in linux. I do not have a windows based environment available at the moment, so if anyone has one to test the windows part, I’ll be glad to have feedbacks.

I’ll have a look at what tests I can add.

Untested win32 constants were found here: https://chromium.googlesource.com/chromium/deps/perl/+/master/c/i686-w64-mingw32/include/ws2tcpip.h

ocramz commented 5 years ago

@lsix thank you! It looks good :) yes, some tests would be very beneficial. Looking forward to merge this as this is a longstanding issue.

lsix commented 5 years ago

I have added basic tests. They will be quite dependent of the firewall settings of the host running the tests (I have to use ip6tables -F before I run the tests on my current workstation).

I will try to set-up a windows based environment in the days to come to test this code.

lsix commented 5 years ago

OK, I have been able to test this code on windows :tada: (sory for the long delay)

It works, the only issue is that the test hangs on windows, I do not know why… Anyway, they are quite unreliable since they depend a lot on the firewall configuration, do you want to maintain them?

ocramz commented 5 years ago

@lsix thank you ! Yes I'd love to merge and publish a new version with your contribution. Do you have some more insight re. the necessary firewall configuration, and how the tests might fail?

lsix commented 5 years ago

on my system, I need to run ip6tables -F; iptables -F to properly use multicasting (not limited to those tests, and I never had to adjust it properly for real multicast production uses), but this is just the default for my distribution. I do not know how different distributions might react.

If the firewall blocks the datagrams, the tests just fail, this is not such an unexpected behaviour.

On windows however, the test program hangs, probably because the socket resources are not properly cleaned when the timeout happens. I’ll have to investigate that a bit, but it is not directly linked to the multicast socket usage.

audreyt commented 5 years ago

I've manually merged some conflicts and the current WIP is in ipv6 branch in case anyone would like to pick it up.