Re: TCP Broadcast

From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 05/10/04


Date: Sun, 09 May 2004 22:18:10 -0400

In article <c7mmia$rur$1@au-nws-0001.flow.com.au>, user@domain.invalid
wrote:

> I am writing an application using TCP sockets, I don't know the IP
> address of the server and am thinking of using a broadcast to find it.
>
> I am using these examples as a test.
> http://www.ecst.csuchico.edu/~beej/guide/net/examples/server.c
> http://www.ecst.csuchico.edu/~beej/guide/net/examples/client.c
>
> How do you modify these so the client will do a broadcast.
> I had a guess at using use SO_BROADCAST in programs but it doesn't
> appear to change anything.

Read the "Broadcasting" chapter of "Unix Network Programming, Vol.1"

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


Relevant Pages

  • Re: negative estbdelay?
    ... autokey dance and as a result is unable to estimate the delay between ... the broadcast client and the broadcast server. ... client or server config file so it's hard to be sure. ...
    (comp.protocols.time.ntp)
  • Re: negative estbdelay?
    ... the broadcast client and the broadcast server. ... client or server config file so it's hard to be sure. ... disable auth disables authentication. ...
    (comp.protocols.time.ntp)
  • Re: CSocket multiple network adapter
    ... and allows the user to specify the server IP or host in command line ... options to the client or client installer in case there is a router between ... The client sends a UDP broadcast, ... there are multiple network adapters at either the client or server. ...
    (microsoft.public.vc.mfc)
  • Re: UDP broadcasting/multicasting problem
    ... What I want is a server on my LAN to broadcast its address to all machines ... My client starts up a listener on a different known port. ...
    (microsoft.public.vc.mfc)
  • Confused about network broadcasts
    ... What I'm doing is, on the client, to create a broadcast socket, then ... send out a string which the server can recognise. ...
    (comp.sys.acorn.programmer)