TIdIPMCastServer
Implements an IP Multicast server.
Unit
Description
TIdIPMCastServer is a
TIdIPMCastBase descendant that implements an IP multicast server 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)
TIdIPMCastServer implements abstract methods from the ancestor class, and provides additional methods and properties used for loopback diagnostics, socket options, and transmission of Multicast datagrams.
Indicates if the multicast server is active and able to transmit datagram packets.
Description
Active is a published Boolean property in
TIdIPMCastServer that indicates if the multicast server is active and able to transmit datagram packets. Active uses an overriden read access specifier that insures that the
Binding for the server has been initialized and the
socket handle has been allocated. Active is set to False when the server is freed using
Destroy.
Socket descriptor for multicast server transmissions.
Return Value
Description
Binding is a read-only
TIdSocketHandle property that represents the
socket descriptor used by the multicast server to
send datagram packets to multicast clients. The read access specifier for the property insures that the Binding has been initialized, and a datagram
socket handle has been allocated and bound using the
MulticastGroup address and group membership
socket options, as well as the
TimeToLive options indicated in the property values.
Note:
Loopback is set to True during Binding initialization to allow diagnostics.
Indicates if datagrams for the local network module are used for the server.
property Loopback: Boolean;
Description
Loopback is a Boolean property that indicates if Loopback
socket options are used on the
Binding for the multicast server. Loopback indicates if the local network module can deliver multicast datagram packets that were transmitted from that network module. Changing the value of the Loopback property will result in a change to the
socket options for
Binding to reflect the new property value. The default value for the Loopback is
DEF_IMP_LOOPBACK as assigned in the
Create constructor.
Represents the multicast group IP address.
Description
MulticastGroup is a published property in
TIdIPMCastServer that identifies the dotted-decimal representation of the multicast group address for the server. MulticastGroup is used when setting
socket options for a binding used by the multicast server, and when transmitting datagram packets to network interface.
MulticastGroup must contain an IP address acceptable to IsValidMulticastGroup, or an exception can be raised when creating, accessing, or releasing the Binding used by the multicast server.
Port number used to
send datagram transmissions.
Description
Port is a published Integer property in
TIdIPMCastServer that represents the port number used when sending datagram transmissions using the
Send or
SendBuffer method.
Numberof hops allowed across routers and gateways for the datagram transmission.
property TimeToLive: Byte;
Description
TimeToLive is a Byte property that indicates the number of hops permitted in routers and gateways that must handle the datagram transmission. TimeToLive is used to set the
socket options for the
Binding used by the multicast server. Changing the value of TimeToLive forces an update to the
socket options for
Binding. The default value of TimeToLive is
DEF_IMP_TTL as assigned by the
Create constructor.
Constructor for the object instance.
constructor Create(AOwner: TComponent); override;
Parameters
AOwner: TComponent
Owner of the object instance.
Description
Create is the overridden constructor for the object instance. Create calls the inherited Create method using AOwner as the owner of the object instance. Create also assigns the default values for the
Loopback (
DEF_IMP_LOOPBACK) and
TimeToLive (
DEF_IMP_TTL) properties.
Frees the object instance.
destructor Destroy; override;
Description
Destroy is the destructor for the object instance. Destroy sets the
Active property to False, to insure that the IP address for the local binding is removed as a member of the MultiCast Group address. Destroy calls the inherited Destroy method prior to exiting.
Sends a datagram containing a string value.
procedure Send(AData: string);
Parameters
AData: string
String value to be sent in the datagram.
Description
Send is a procedure that allows the multicast server to
send a datagram containing the value in AData to the group address specified in the
MulticastGroup property. Send calls the MulticastBuffer method using values in the
MulticastGroup and
Port properties, as well as the value and length indicated in AData.
Use SendBuffer to transmit a datagram containing non-string values.
Sends a datagram containing a non-string value.
procedure SendBuffer(var ABuffer; const AByteCount: integer);
Parameters
var ABuffer
Buffer containing the content for the datagram.
const AByteCount: integer
Number of bytes in the buffer to be sent in the datagram.
Description
SendBuffer is a procedure that allows the multicast server to
send a datagram containing the non-string value in ABuffer to the group address specified in the
MulticastGroup property.
Send calls the MulticastBuffer method using values in the
MulticastGroup and
Port properties, as well as the value and length indicated in ABuffer and AByteCount.
Use Send to transmit a datagram containing a string value.