Re: Winsock1 broadcast question?



"Andrew" <Andrew@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:44080E2E-1767-4EBD-9E51-97EDEEAFEB8F@xxxxxxxxxxxxxxxx
What I would like to do is, I have a server that I wanted to broadcast
information over the network, and have about 5 clients listening on a
specified port. They all receive the information and process it what ever
why
I want it to. I can do this on a single point to point connection, but I
don't know how to do this with multiple computers.

How can I broadcast information to multiple computers at once?

I have tried some code from the net, but can't seem to get it to work.

Any body have any ideas?

Before you can send broadcasts, you must enable SO_BROADCAST on the UDP
socket. See MSKB Q237688. To send a broadcast, set RemotePort to whatever
the other side is using, and set RemotHost to "255.255.255.255", and send.

Also, it's best to make the server listen on a specific port, such as 5555,
but don't make the client listen on specific ports, let them use a dynamic
port. This can be done by setting LocalPort to 0 before the first Send. If
you use specific ports for the clients, you will run into problems with
firewalls, especially with clients connecting over the Internet. When each
client starts up, it should send a dummy packet to the well known port of
the server, so the server knows which port the client is using and send to
that particular IP and port. The server can tell the port used by the client
by checking RemotePort property in DataArrival event. This way only the
server needs to listen to a well known port.

If you want the client to listen to a well known port, then that's your
choice. It will certainly work fine in a LAN except when the clients are
running XP+SP2, which introduced Windows Firewall and it blocks the ports by
default, so you have to open them on clients and server. If the clients used
a dynamic ports, then you only need to open the port at the server, so it's
less of a headache.

Also, if the client is behind a router, such as those using the Internet
with common routers like Linksys routers, then you have to open the port as
well in the router, but this is not required when you use dynamic ports.

Good Luck!


.



Relevant Pages

  • RE: Printing from Win9x clients stops
    ... > and make sure this software does not interfere with SBS Server. ... > clients, please disable it and try again. ... Create a local printer and redirect the port to the network server. ...
    (microsoft.public.windows.server.sbs)
  • Re: RealVNC
    ... Default listening port for RealVNC server that runs on the machine on which ... Then there is default Java listening port on port 5800 on the client machine ...
    (microsoft.public.windows.server.sbs)
  • Re: RealVNC
    ... I use VNC behind server ... Default listening port for RealVNC server that runs on the machine ... And then "other"party - not the client can run RealVNC Viewer in ...
    (microsoft.public.windows.server.sbs)
  • RE: Cannot make either RWW or Remote Desktop Connection to server internally yet 3389 responds
    ... SBS server from internal and external network. ... Let us refer to the following steps to troubleshoot the issue: ... to listen on port 3389. ... How to change the listening port for Remote Desktop ...
    (microsoft.public.windows.server.sbs)
  • Re: RealVNC
    ... I use VNC behind server ... Then there is default Java listening port on port 5800 on the client ...
    (microsoft.public.windows.server.sbs)