Indy 9
|
TIdIPMCastListenerThread = class(TIdThread)
property AcceptWait: integer;
constructor Create(Owner: TIdIPMCastClient); reintroduce;
destructor Destroy; override;
procedure IPMCastRead;
procedure Run; override;
Run creates a TList that is used to store references to the socket handles in TIdIPMCastClient.Bindings that are used to accept incoming datagrams for the multicast client. Run iterates over socket handles in the list to retrieve the socket descriptor and initalize the Buffer used for reading incoming datagram packets. Run can raise an EIdUDPReceiveErrorZeroBytes exception zero (0) bytes are read from a connection accepted by the listening thread.
Run also examines the TIdIPMCastClient.ThreadedEvent for the associated multicast client to determine if the IPMCastRead method can be triggered in the content of the multicast client, or if it must be synchronized to the main VCL thread.
Run clears and frees the TList used for socket handles prior to exiting from the method.