Availability of a broadcast server over the network

I am writing a client-server application where the client should be able to automatically detect the presence of the server on the network so that the user does not have to deal with manual configuration.

I think the server should somehow broadcast its presence. What is the best way to do this?

The server must run on Windows / Linux or OS X, so the solution must be cross-platform. The client and server are written in C ++.

+3
source share
2 answers

You should look at ZeroConf as a general way of conveying this information. It is also known as Bonjour (formerly Rendezvous) on Apple systems, but this is not an Apple-specific thing - many other devices (both embedded and OS) broadcast / use it.

There are many libraries that can work with ZeroConf in many languages ​​- finding one of them is a question of Googling. Keep in mind that ZeroConf itself is part of the ad / process detection and identifies the machine and socket, but then you can do whatever you want through the sockets (s) that you identify.

For example, Apache mod_zeroconf allows you to translate Apache sites. Your decision will depend on which licensing and use rights you depend on.

+4
source

, . (braindead) : 1) , ; 2) ( ) (), . , , UDP, TCP, UDP.

+2

Source: https://habr.com/ru/post/1715240/


All Articles