MCast Class

Properties   Methods   Events   Configuration Settings   Errors  

The MCast class is used to multicast UDP datagrams to multicast capable hosts in multicast capable subnets. It can act both as a client and a server and communicate with any number of hosts simultaneously, as well as generate and receive broadcast packets.

Syntax

class ipworks.MCast

Remarks

The MCast class is very similar to UDPPort, except for some additional properties that provide support for multicast datagrams. To send datagrams to a multicast group, simply assign the address of the group to remote_host. To receive datagrams from one or more groups, assign the group addresses to multicast_group one by one (after the class is activated. time_to_live allows to specify how many subnets a packet should be allowed to receive. receive_interface and send_interface allow you to select the network interface for multicast operations.

The class is activated/deactivated through the active property. This property enables or disables sends or receives. The data can be sent in the same way as UDPPort, by calling the send method with a Text parameter or via the data_to_send property. The destination is specified using the remote_host and remote_port properties. Inbound data is received through the on_data_in event.

Property List


The following is the full list of the properties of the class with short descriptions. Click on the links for further details.

accept_dataEnables or disables data reception (the DataIn event).
activeEnables or disables sending and receiving data.
data_to_sendA string of data to be sent to the remote host. Write-only property.
local_hostThe name of the local host or user-assigned IP interface through which connections are initiated or accepted.
local_portThe UDP port in the local host where MCast binds.
loopbackEnables or disables loopback of data sent to the multicast group.
multicast_groupMulticast group to join or leave.
receive_interfaceThe interface with which to receive multicast packets. If empty, default is used.
remote_hostThe address of the remote host (multicast group).
remote_portThe UDP port in the remote host.
send_interfaceThe interface from which multicast packets are sent. If empty, default is used.
time_to_liveThe maximum number of subnets that a multicast datagram can traverse.

Method List


The following is the full list of the methods of the class with short descriptions. Click on the links for further details.

configSets or retrieves a configuration setting.
do_eventsProcesses events from the internal message queue.
resetReset the class.
sendSends data to the remote host.

Event List


The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.

on_data_inFired when data is received.
on_errorInformation about errors during data delivery.
on_ready_to_sendFired when the class is ready to send data.

Configuration Settings


The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.

CaptureIPPacketInfoUsed to capture the packet information.
DestinationAddressUsed to get the destination address from the packet information.
DontFragmentUsed to set the Don't Fragment flag of outgoing packets.
LocalHostThe name of the local host through which connections are initiated or accepted.
LocalPortThe port in the local host where the class binds.
MaxPacketSizeThe maximum length of the packets that can be received.
QOSDSCPValueUsed to specify an arbitrary QOS/DSCP setting (optional).
QOSTrafficTypeUsed to specify QOS/DSCP settings (optional).
ShareLocalPortIf set to True, allows more than one instance of the class to be active on the same local port.
SourceIPAddressUsed to set the source IP address used when sending a packet.
SourceMacAddressUsed to set the source MAC address used when sending a packet.
UseConnectionDetermines whether to use a connected socket.
UseIPv6Whether or not to use IPv6.
AbsoluteTimeoutDetermines whether timeouts are inactivity timeouts or absolute timeouts.
FirewallDataUsed to send extra data to the firewall.
InBufferSizeThe size in bytes of the incoming queue of the socket.
OutBufferSizeThe size in bytes of the outgoing queue of the socket.
BuildInfoInformation about the product's build.
CodePageThe system code page used for Unicode to Multibyte translations.
LicenseInfoInformation about the current license.
ProcessIdleEventsWhether the class uses its internal event loop to process events when the main thread is idle.
SelectWaitMillisThe length of time in milliseconds the class will wait when DoEvents is called if there are no events to process.
UseInternalSecurityAPITells the class whether or not to use the system security libraries or an internal implementation.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks 2020 Python Edition - Version 20.0 [Build 8307]