I would like to see native support for joining multicast groups.
Jeff
Multicast support
Moderator: Klaus
Re: Multicast support
Yeah. This would be nice. Any workarounds?
Re: Multicast support
Maybe multicast can be supported with some sort of socket options enhancement. Or an enhancement of the 'accept' command. The first might be more general.
Re: Multicast support
Or maybe (as inspired by imagePixmapID), there could be a function to get the handle of the socket and this can be passed to an external.
Re: Multicast support
Here is how it might be done without socket options:
An 'open datagram socket' is allowed to have an IP address in the multicast range. If a nonempty value is specified in defaultNetworkInterface then, it is set appropriately for the outgoing source socket. Loopback is enabled to allow receivers to be on the same computer. The TTL is left at 1; allowing use only in the local LAN. No syntax change is needed.
The 'accept datagram socket' command is enhanced to allow the optional clause 'from group <IP-address>'. This allows datagrams to be received from the specified multicast group. No other groups can be added for that port. No source list or source blocking is available.
Buffer sizes are set to at least the maximum size of a datagram socket in both cases.
An 'open datagram socket' is allowed to have an IP address in the multicast range. If a nonempty value is specified in defaultNetworkInterface then, it is set appropriately for the outgoing source socket. Loopback is enabled to allow receivers to be on the same computer. The TTL is left at 1; allowing use only in the local LAN. No syntax change is needed.
The 'accept datagram socket' command is enhanced to allow the optional clause 'from group <IP-address>'. This allows datagrams to be received from the specified multicast group. No other groups can be added for that port. No source list or source blocking is available.
Buffer sizes are set to at least the maximum size of a datagram socket in both cases.
Re: Multicast support
An alternative to the optional clause 'from group <ip address>' for accept is to allow an address:port pair where a port is used.
This it might be like this:
One problem with that is that (as is) it looks the same in openSockets as a socket opened for sending datagrams to the multicast group.
The solution for that would be the same as that for the problem of accept datagram and accept for TCP looking the same in openSockets. Allowing an ID (connection name) suffix after a vertical bar (as is allowed with open socket) can make sure the accept and the open socket designators are distinct.
This might be simpler and easier to understand. It does not grow that well when multiple groups are added.
So, there are these two syntaxes to consider for enhancing accept datagram and the possibility of I/O properties in general or socket options in specific.
This it might be like this:
Code: Select all
accept datagram connections on port 239.9.4.211:5000 with message "gotDatagram"
The solution for that would be the same as that for the problem of accept datagram and accept for TCP looking the same in openSockets. Allowing an ID (connection name) suffix after a vertical bar (as is allowed with open socket) can make sure the accept and the open socket designators are distinct.
This might be simpler and easier to understand. It does not grow that well when multiple groups are added.
So, there are these two syntaxes to consider for enhancing accept datagram and the possibility of I/O properties in general or socket options in specific.