UDP client lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- michoux · 2019-09-06 06:34 Hello, I have an application that sends some UDP packets over network - I can tell the APP to which IP data will be sent. I would like to get this packets read in Lazarus. Any recommendations where to start? Thanks a lot. Michoux ---------------------------------------------------------------------- Thaddy · 2019-09-06 07:05 Look here for a good and simple example using synapse: https://stackoverflow.com/questions/9786011/delphi-synapse-udp-client- server This also works cross-platform with Freepascal with the latest synapse. ---------------------------------------------------------------------- michoux · 2019-09-06 07:58 Hello, Thanks, good example. But what bothers me is that read is done on timer. I can not know when packet will be sent from other app. ---------------------------------------------------------------------- Remy Lebeau · 2019-09-06 19:44 Quote from: michoux on September 06, 2019, 09:58:08 amBut what bothers me is that read is done on timer. I can not know when packet will be sent from other app. Then simply do the read in a worker thread instead. Indy has a TIdUDPServer component that does the reading for you using an internal worker thread, and then fires an OnUDPRead event whenever a packet arrives.  You can choose whether that event is fired in the context of the UI thread or the reading thread.