Atozed Forums

Full Version: TIdUDPServer connected clients
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello; is it possible to determine the clients currently connected to a TIdUDPServer?  I can do this with the TCP server, but have not found a way to do it with the UDP server.  Thank you.
(12-19-2020, 05:52 PM)_b-har Wrote: [ -> ]is it possible to determine the clients currently connected to a TIdUDPServer?

UDP is a connection-less protocol. There are no “connected clients”, only datagrams. You need to keep track of clients yourself in your own code. When you receive a new datagram from an unknown client, add that client to a list somewhere. If you don’t receive any datagram from that client for awhile, or if you receive a goodbye datagram (if your datagram protocol has one), remove that client from the list.

(12-19-2020, 05:52 PM)_b-har Wrote: [ -> ]I can do this with the TCP server

Because TCP has a concept of connections, and TIdTCPServer keeps track of them for its own purposes, but makes that list available to you as well.

(12-19-2020, 05:52 PM)_b-har Wrote: [ -> ]but have not found a way to do it with the UDP server.

Because there isn’t one.