Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Broascastign and server discovery.

1 view
Skip to first unread message

Luis

unread,
Apr 12, 2001, 5:32:36 PM4/12/01
to
Hello,

I'm new to thei, so please, try to understand.

I'm trying to do something here that requires server discovery. As far as I
know, you are suppose to seebd your query to address 255.255.255.255, ten
everybody listen to but only the appropiate server responds.

I have no clue on how to implement this with indy. Should I use the
TCPClient and try to connect to 255.255.255.255? I don't think it's going to
work.

Can anybody has worked on something like this before? I was searching the
borland newsgroups but didn't find anything. Any code fragment or sample
will be gratly appreciated.

regards,

Loius


Andy M.

unread,
Apr 13, 2001, 5:39:13 AM4/13/01
to
You need to send a UDP message to the INADDR_BROADCAST (255.255.255.255)
address. Then every station in the network will receive the message.
Nevertheless you'll need as well another UDP socket that listens to the
specific port that you're using.
This socket will then receive the message. Now you can send a different
message back to the sender, or you use another port to send, which requires
2 sockets each on the sender and the receiver side.

Simplified version:
Let's say SockA is sending the stirng 'SEARCH' as a broadcast to the Port
5000.
On the other side, where your server is running there has to be a Socker
SockB that's listening Port 5000. If something arrives, SockB checks if the
Data is 'SEARCH'. If so,
SockC that is as well on the server side will send 'RESULT' to the address
where the 'SEARCH' came from, using Port 5001. On the side that originally
sent the 'SEARCH', there is a socket SockD that's listening to Port 5001.
This Socket will receive the 'RESULT' string and therefore know that a
server exists at the address where the 'RESULT' came from.

I don't know how to do it in Indy, since I don't use it. I'm quite sure that
ICS offers UDP sockets...

Andy


Jan Pedersen

unread,
Apr 13, 2001, 8:18:08 AM4/13/01
to
In article <3ad6c9a0_2@dnews>, andy.m...@gmx.net says...
:You need to send a UDP message to the INADDR_BROADCAST (255.255.255.255)
:
:
Indy does support UDP and broadcasting.
Try with the Broadcast(Message: string; port: integer);
Alternately try setting the Enable Broadcast property in the object
inspector.

Luis A. Burgos

unread,
Apr 15, 2001, 9:59:49 AM4/15/01
to
Yep!

That was it. It's working right now!!


Thanks a lot.

Luis

Luis A. Burgos

unread,
Apr 15, 2001, 9:58:59 AM4/15/01
to
Thanks Jan,

I did it and it worked!

regards,

Luis


0 new messages