Delphi - Udp

// Process the message (e.g., display in a memo) TThread.Queue(nil, procedure begin Memo1.Lines.Add(Format('[%s:%d] %s', [RemoteIP, RemotePort, ReceivedString])); end); end;

For production code, consider using a higher-level abstraction or message queue, but for many real-time and discovery scenarios, UDP in Delphi is both efficient and elegant. delphi udp

To send raw bytes: