Re: UDP broadcasting/multicasting problem
- From: "Dan Baker" <dbmail>
- Date: Tue, 27 Mar 2007 09:49:35 -0600
"Sinu James" <abc@xxxxxxx> wrote in message
news:euapus$sn4$1@xxxxxxxxxxxxxxxxxxxxxxxx
Hello ,
What I want is a server on my LAN to broadcast its address to all machines
on the LAN.
Using UDP broadcasting or multicasting I was hoping to send the server
information across the LAN so that interested clients can establish
connections.
However, all broadcasts and multicast sample code dont seem to work on my
LAN (which I have tested successfully on other networks).
The router may not be configured for UDP broadcasts.
Is there any other alternative for the server to broadcast this info to
the clients without a central server mechanism?
Certain applications are able to do on the same LAN and they "seem" to
use UDP connections. :-(
I have a client/server application that does the following:
1) My server starts a thread that simply listens on a known UDP port for a
message from anywhere/anyone.
2) My client starts up a listener on a different known port.
3) My client broadcasts a message (including it's own ip and port#) to all
ip's (INADDR_BROADCAST) on the known port.
4) When the server gets the broadcast message, it then send a message back
to the client with it's own ip and the real port# it is suppose to
communicate on.
5) The client gets a message on it's listening port, and this message
contains the information about the server that this client application needs
to establish a real connection to the server.
Whew. Sounds like a mess, but it works nicely. All these messages easily
work within the LAN, but never leave through a router. Most routers are
configured to drop broadcast messages. The biggest problem is each app that
sets up a listener, causes an alert to popup on the screen, and the end-user
must "OK" the listener to not be blocked.
Also, we use another method of detecting the server (by enumerating all
services on all computers, and looking for our service name).
Good luck with your project. Hope this helps.
DanB
.
- Follow-Ups:
- Re: UDP broadcasting/multicasting problem
- From: Sinu James
- Re: UDP broadcasting/multicasting problem
- References:
- UDP broadcasting/multicasting problem
- From: Sinu James
- UDP broadcasting/multicasting problem
- Prev by Date: Re: Strange problem initialising class members
- Next by Date: Re: CEdit white
- Previous by thread: UDP broadcasting/multicasting problem
- Next by thread: Re: UDP broadcasting/multicasting problem
- Index(es):
Relevant Pages
|