Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TIdUDPServer connected clients
#1
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.
Reply
#2
(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.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)