Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding mcast support again? #446

Closed
complyue opened this issue Apr 29, 2020 · 3 comments
Closed

Consider adding mcast support again? #446

complyue opened this issue Apr 29, 2020 · 3 comments

Comments

@complyue
Copy link
Contributor

I see #381 has been concluded, but as I'm re-implementing in Haskell a swarm control infrastructure managing clusters of number crunching servers originally implemented in Python, I miss basic UDP mcast support very much. No streaming requirement, just job announcement and discovery with single frag UDP packets, further comm always resorts to TCP connections.

network-multicast seemingly will work for me, but it feels weird I'd need another separate package to do that.

As for API issue, can you consider add one like setSocketOptionBuf, or a same named one in ByteString module? Like that we have sendBuf and send in ByteString superseding that in top-level ?

In Python it's all handled by socket package like:

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

if is_mcast:
    # join the multicast group
    group = socket.inet_pton(socket.AF_INET, swarm_ip)
    ifa = socket.inet_pton(socket.AF_INET, self.mcast_through or "0.0.0.0")
    mreq = group + ifa
    sock.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq)

sock.bind((swarm_ip, self.swarm_port))

64-bit suffices with mreq for IPv4, so event an Int may probably work, but may be not a good idea.

@kazu-yamamoto
Copy link
Collaborator

We will have such APIs when #445 is merged :)

@kazu-yamamoto
Copy link
Collaborator

Not correct. master already has getSockOpt and setSockOpt!

@complyue
Copy link
Contributor Author

sure, then I'll use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants