How to get ip addresses of all running servers on UDP?

Deal with winsock and UDP. Write on one PC, no LAN. On the client send a broadcast request:

sockaddr_in broadcast;
// enable broadcasts
int enableBroadcast = 1;
setsockopt(ClientSocket, SOL_SOCKET, SO_BROADCAST, (char*)&enableBroadcast, sizeof(enableBroadcast));

broadcast.sin_family was = AF_INET;
broadcast.sin_port = htons(Port);
broadcast.sin_addr.s_addr = INADDR_BROADCAST;
// a particular message to which the server will reply with information about yourself
char testmessage[] = "test\n";
sendto(ClientSocket, testmessage,sizeof(testmessage), 0, (sockaddr*)&broadcast, sizeof(broadcast));

// accept the server information 
infoAboutServer char[1024]; 
ZeroMemory(infoAboutServer, 1024);
recvfrom(ClientSocket, infoAboutServer, 1024, 0, (SOCKADDR*)&server, &sizeOfserver);

Server:
char RecvBuf[1024];
while(1){
ZeroMemory(RecvBuf, BufLen);
// receive message
recvfrom(sListen, RecvBuf, 1024, 0, (SOCKADDR*)&SenderAddr, &SenderAddrSize);
// if the request message information that is sent in response to the information
 if (RecvBuf == "test") {
 SenderAddr.sin_addr.s_addr = inet_addr(inet_ntoa(SenderAddr.sin_addr));
 sendto(sListen, infoMessage.c_str(), infoMessage.size(), 0, (SOCKADDR*)&SenderAddr, SenderAddrSize); 
 } 
}

I think that if the network is running multiple servers, the client recvfrom will only come one first response from any of the servers?If so, how to obtain responses from all servers?
April 19th 20 at 12:41
1 answer
April 19th 20 at 12:43
Solution
You will receive a response from all servers that received the broadcast request.
Except those who have a blocked response, firewall om. - jerome_Brakus commented on April 19th 20 at 12:46
@jerome_Brakus, It's perfectly normal:
receiving a broadcast request

They don't get the request. - adele.Hahn commented on April 19th 20 at 12:49
@adele.Hahn, Yes, and then from the entry in the log appear? Type, came, but were ignored? - jerome_Brakus commented on April 19th 20 at 12:52
@jerome_Brakus, comrade, are you talking about? What is the log? The author of the question there is nothing about a log.
If you have a question ask it. Why this is trolling. - adele.Hahn commented on April 19th 20 at 12:55
@adele.Hahn, To the fact that your answer is not accurate (not technically correct). Little to request, it is necessary to answer it. And then your answer is meaningless: "you will receive a response from all servers that responded to him" :) - jerome_Brakus commented on April 19th 20 at 12:58
@jerome_Brakus, it is understood that servers the same and hang on the same port on different computers. Then they will answer, if you get a request. The source server is given and he (the server) responds.
It is true there are bugs in the code, but this is the question is not relevant. - adele.Hahn commented on April 19th 20 at 13:01
@adele.Hahn, see my first comment on your answer. We went around the circle. - jerome_Brakus commented on April 19th 20 at 13:04

Find more questions by tags UDPC++