multicast module
Defaults, constants, and functionality, for multicasting.
- multicast.ack_command = b'ack '
Command used in all communications as acknowledgement.
- multicast.depth_command = b'depth '
Command used in all communications to request the toggling the depth stream.
- multicast.encoding = 'utf-8'
The encoding to be used when communicating.
- multicast.multicast_addr = '224.223.222.221'
The address used by the multicast group.
- multicast.multicast_group = ('224.223.222.221', 61453)
The tuple of the multicast address and port.
- multicast.multicast_port = 61453
The port used by the multicast group.
- multicast.next_command = b'next '
Command used in all communications to request the next playlist media.
- multicast.padding = 16
The length of byte array to be used in all communications.
- multicast.play_command = b'play '
Command used in all communications to request playback to commence.
- multicast.prepare(i)
- Parameters
i – a value
Stringify, pad and encode the value, i, for communication.
- Returns
a prepared byte array.
- multicast.quit_command = b'quit '
Command used in all communications to request application shutdown.
- multicast.send_message(sock, message, address)
- Parameters
sock – the socket to send the communcation by
message – the message to send
address – the address to send the message to
Send a given message, to a given address, via a given socket.
Note
Ensures all bytes are sent.
- multicast.setup_source()
Setup instance as a multicast source.
- Returns
a socket to send and receive communications by.
Warning
There wants to be only one source on the local network.
- multicast.setup_target()
Setup instance as a multicast target.
- Returns
a socket to send and receive communications by.
- multicast.stop_command = b'stop '
Command used in all communications to request playback to cease.