Re: Howto find multiple servers using TCP
- From: "AliR \(VC++ MVP\)" <AliR@xxxxxxxxxxxxx>
- Date: Tue, 11 Dec 2007 21:43:16 GMT
I can't think of another way.
But if the server program is your program, then I have a suggestion.
I have a server that alot of clients connect to, and I really didn't want to
have to input the server address in every client. So what I did was I used
a multicast socket to find the server. The server listens to traffic on a
particular multicast address, and when the clients want to find the server
application, they would send a message (where are you) using a multicast
socket with that particular address, the server would receive the message
and send a reply (Here I am) with its IP address. Now if there are more than
one server, the client would get multiple "Here I am" replies. This entire
process takes less than a second.
AliR.
"amccombs" <amccombs@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:129DBBB8-AD79-4588-91E0-0DF847EB11FB@xxxxxxxxxxxxxxxx
I have to search my subnet to look for servers that are listening on port
30715. I am using one thread of a derived class of CAsyncSocket. I am
using
CEvents with a 200 milisecond timeout, if there is no connection within
the
200 miliseconds, then I know there is no serer. However searching from
192.168.1.1 to 192.168.1.254 takes a long time. Is there a better way?
.
- Prev by Date: Re: Toolbar not opening
- Next by Date: Re: COM - VC6++, MFC, Thread
- Previous by thread: COM - VC6++, MFC, Thread
- Next by thread: Re: Howto find multiple servers using TCP
- Index(es):
Relevant Pages
|