Home Forums Support Two way client server setup

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1012
    Anonymous
    Inactive

    I have scenario where there is one server application and many clients. The clients need to be able to send messages to the server which is simple and covered in the Client-Server tutorial. I also need the server to be able to send messages out to all the clients. What would be the best way to accomplish something like this? Would it make sense to do a UDP broadcast for all the clients to pick up? Is there any type of tutorial that shows two-way communication? Thanks.

    #1016
    Anonymous
    Inactive

    If you are working in a Desktop environment you can try with UDpbroadcast.
    Or you can use an approach like this already suggested here
    On Xamarin Android I can report UDPbroadcast is not working.

    #1031
    Anonymous
    Inactive

    UDP broadcast should work on Android but you will have to use the subnet specific broadcast address, ie something like 192.168.1.255 (depending on your ip configuration) instead of 255.255.255.255. If this isn’t working we definitely would like to know so if you could confirm that would be appreciated.

    UDP broadcast can be quite spammy (in terms of overall network load) so if the number of clients is small you are probably better just looping over the connections in your server side code and sending the packet to each client. Which performs better will depend on the specifics of your network and what you’re sending so you will probably want to experiment. It’s also worth noting that UDP broadcasts ‘can’ be tricky to debug if there is an issue.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.