Indy 9
TIdIPMCastClient
Hierarchy, Properties, Methods, Events, See Also, Unit: IdIPMCastClient
Implements an IP Multicast client.
TIdIPMCastClient = class(TIdIPMCastBase)
Unit
IdIPMCastClient
Description
TIdIPMCastClient is a TIdIPMCastBase descendant that implements an IP multicast client component using the UDP transport, as described in the Internet Standards documents:

  • RFC 1112 - Host Extensions for IP Multicasting. (http://www.rfc-editor.org/rfc/rfc1112.txt)

  • RFC 1458 - Requirements for Multicast Protocols. (http://www.rfc-editor.org/rfc/rfc1458.txt)

TIdIPMCastClient implements abstract methods from the ancestor class, and provides additional methods and events that allow use of multiple bindings and an event handler for datagram receipt. TIdIPMCastClient also provides a ListenerThread and an optional threaded read capability for datagram receipt.


TIdIPMCastClient.Active
TIdIPMCastClient, See Also
Indicates that the client has a binding with a valid socket handle.
property Active;
Description
Active is a published Boolean property in TIdIPMCastClient. The read access specifier for Active calls the inherited read access specifier to keep track of the design-time value for the property. Active will be True when it is active at design-time, or when the client currently has a binding with a valid socket handle assigned.

TIdIPMCastClient.Bindings
TIdIPMCastClient, See Also
Represents socket descriptor(s) used to listen for incoming data.
property Bindings: TIdSocketHandles;
Description
Bindings is a TIdSocketHandles property that represents one or more socket descriptors used to listen for incoming data packets in the multicast client. Bindings is used when the TIdIPMCastListenerThread allocated for the client is executed. Bindings is used to set the socket options required when joining or departing the specified MulticastGroup.

TIdIPMCastClient.BufferSize
TIdIPMCastClient, See Also
Indicates the buffer size to use for datagram receipt.
property BufferSize: Integer;
Description
BufferSize is an Integer property that represents the size of the buffer to allocate when the listener thread receives a datagram for the multicast client. The default value for BufferSize is ID_UDP_BUFFERSIZE, as assigned in the Create constructor.

TIdIPMCastClient.DefaultPort
TIdIPMCastClient, See Also
Default port number for socket descriptors created for the multicast client.
property DefaultPort: integer;
Description
DefaultPort is an Integer property that represents the default port number used when creating Bindings for the multicast client. Changing the value of DefaultPort will also update the value in the TIdSocketHandles.DefaultPort property in Bindings.

TIdIPMCastClient.MulticastGroup
TIdIPMCastClient, See Also
Represents the multicast group IP address.
property MulticastGroup;
Description
MulticastGroup is a published property in TIdIPMCastClient that identifies the dotted-decimal representation of the multicast group address for the client. MulticastGroup is used when setting socket options for a binding used by the multicast client.

MulticastGroup must contain an IP address acceptble to IsValidMulticastGroup, or an exception can be raised when creating, accessing, or releasing the Bindings used by the multicast client.


TIdIPMCastClient.ThreadedEvent
TIdIPMCastClient, See Also
Indicates if threaded reads are performed using an event handler in multicast client.
property ThreadedEvent: boolean;
Description
ThreadedEvent is a Boolean property that indicates if the multicast client should allow use of threaded reads from it's listener thread. When ThreadEvent is True, the TIdIPMCastListenerThread will use the read method defined in the listener thread to trigger the TIdIPMCastClient.OnIPMCastRead event handler. When ThreadEvent is False, the read method is synchronized to the main VCL thread.

The default value for ThreadedEvent is DEF_IMP_THREADEDEVENT as assigned in the Create constructor.


TIdIPMCastClient.Create
TIdIPMCastClient, See Also
Constructor for the object instance.
constructor Create(AOwner: TComponent); override;
Parameters
AOwner: TComponent
Owner of the object instance.
Description
Create is the constructor for the object instance. Create calls the inherited Create method using AOwner as the owner of the object instance. Create assigns ID_UDP_BUFFERSIZE as the default value for the BufferSize property, and DEF_IMP_THREADEDEVENT as the default value for the ThreadedEvent property. Create also allocates resources required for the Bindings property.

TIdIPMCastClient.Destroy
TIdIPMCastClient, See Also
Frees the object instance.
destructor Destroy; override;
Description
Destroy is the destructor for the object instance. Destroy insures that Active is set to False, and frees and releases resources allocated in the Bindings property. Destroy calls the inherited method prior to exiting.

TIdIPMCastClient.OnIPMCastRead
TIdIPMCastClient, See Also
Event handler signalled when a datagram is available for the multicast client.
property OnIPMCastRead: TIPMCastReadEvent;
Description
OnIPMCastRead is a TIPMCastReadEvent property that represents the event handler signalled when a datapacket has been received on the socket descriptor for the multicast client. OnIPMCastRead allows the client to implement processing required to read and handle the datagram contents.

Applications must assign a procedure to the TIPMCastReadEvent event handler to allow responding to the event notification. The event handler can access arguments that include:

  • Sender - Multicast cLient for the event notification.

  • AData - Stream containing the contents of the datagram.

  • ABinding - Socket descriptor used to read the incoming datagram.

Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.