Internet Direct (Indy) Version 9.0.2 Beta
TIdUDPListenerThread.Run
Performs the main thread of execution for the listener thread.

procedure Run; override;
Description
The Run method provides the main thread of execution for the TIdUDPListenerThread. Run insures that all TIdSocketHandles in Bindings are selected.

While the server is not Stopped, Run will check each socket handle for incoming data and receive the new data into Buffer. Buffer is repositioned to the beginning of the buffer after reading incoming data. Run will raise an EIdUDPReceiveErrorZeroBytes if there is an error reading from one of the socket handles.

Run uses the ThreadedEvent property of the TIdUDPServer to determine how read event notifications to the server are performed. When the server is using threaded events, Run calls UDPRead. Otherwise the UDPRead method is a synchronised method call.

Run is invoked by making the TIdUDPServer active when the listener thread is started.