0

I know how to send a message from server

ABinding.SendTo(ABinding.PeerIP, ABinding.PeerPort, 'jhon|zack|randy', ABinding.IPVersion);

to one , but how to do it to several? Need to create an array: record ip data and port, or have built-in functions

rustam
  • 21
  • 4
  • You need to keep track of the peers yourself, `TIdUDPServer` does not do it for you (unlike `TIdTCPServer`). Then you can send messages to each peer individually as needed. Though, for multi-peer messaging, you should consider using subnet broadcasts or better multicasting, so that you can send a message to a single IP/Port and it will be delivered to all interested peers automatically. – Remy Lebeau Dec 13 '18 at 19:42
  • @remy question, on the client I assign BoundPort, I read on the server on what port to send back ABinding.PeerPort, it is different from BoundPort. And it is only in the mobile network. How to fix it. – rustam Dec 16 '18 at 13:31
  • there is nothing to fix. A mobile client connecting to your server via cellular (vs WiFi) is being routed through the cell network to reach your server, so it is not a *direct* connection to your server, it is being proxied. So you are seeing the proxy's port. That is OK. Just send back using the `PeerPort` you are given, the message will reach the intended client one way or another – Remy Lebeau Dec 16 '18 at 19:49

0 Answers0