IonicWind Software

IWBasic => Network Client/Server programming => Topic started by: Egil on April 02, 2009, 03:59:36 AM

Title: Broadcast address
Post by: Egil on April 02, 2009, 03:59:36 AM
I want to broadcast a message to all inhouse clients, what IP address should be used?
Checking the network adapter status on the computer I am using at the moment gives this:

           IP address: 10.0.0.1
      Network mask: 255.255.255.0
Standard Gateway: 10.0.0.138

Reading several internet sources make me rather confused. I think that  10.0.0.255 is the address I should use. Can any forum user confirm this, please?
Title: Re: Broadcast address
Post by: Ficko on April 02, 2009, 10:04:31 AM
I am not sure what you wanna use for broadcast but

if you want to use net send, the messenger service has to be enabled on all computers that you want to recieve the message.

-For security reason it isn't a good approach-

to broadcast:

net send * message

-And Vista dosn't have this service anymore.-

regards
Ficko

Title: Re: Broadcast address
Post by: Ficko on April 02, 2009, 10:35:18 AM
Hups!

I just recognized we are in the "Client/Server" programming section. :-[

So just ignore my stupid reply. ;D
Title: Re: Broadcast address
Post by: sapero on April 02, 2009, 11:32:44 AM
10.0.0.255 is valid for broadcasting, I've seen it often in my LAN, but always used the more general  255.255.255.255.
To enable broadcasting you need to prepare the unbound socket with setsockopt api, and then it should be bound (bind api) to one of network cards.
int enabled = 1
setsockopt(hSocket, SOL_SOCKET, SO_BROADCAST, &enabled, len(enabled))
Title: Re: Broadcast address
Post by: Egil on April 02, 2009, 11:54:56 PM
Thanks guys!
I am part of a radio amateur contest team participating in international contest in the multioperator/multiband classes. Most of these contests have rules that require all contacts to be given serial numbers on every contact referrenced to time, regardless of what frequency band the contact is done. When the operating posts  are separated by several hundred meters to avoid radio interferrence, this is difficult to achieve. And we see that we are loosing scores for that reason.
Since we already are using laptops for logging at each operating post, we will link these in a wireless LAN. And then let a controlling position broadcast the next unused serial number at regular intervals on this network, and the first taker get assigned this number.
I have been experimenting with the routines postol350 supplied in this forum thread, coded by Andrew:  http://www.ionicwind.com/forums/index.php/topic,2166.0.html . These routines are very simple, but works very fast. But now I will  try to do the same thing using the EB Network library.

Using 255.255.255.255 certainly broadcasts  to all computers in my house, but I notice that my routers DSL line indicator lamp is actually activated when using this adress. And I dont know if this means that I am spreading my signals on the web or not. This does not happen when I use 10.0.0.255. Therefore I am seeking advice here.
Title: Re: Broadcast address
Post by: Allan on April 04, 2009, 03:30:32 PM
Egil:

These links may have the info you are looking for:

http://compnetworking.about.com/od/workingwithipaddresses/l/aa042400b.htm (http://compnetworking.about.com/od/workingwithipaddresses/l/aa042400b.htm)

http://compnetworking.about.com/od/workingwithipaddresses/l/aa042400c.htm (http://compnetworking.about.com/od/workingwithipaddresses/l/aa042400c.htm)

Allan
Title: Re: Broadcast address
Post by: Egil on April 08, 2009, 03:29:07 AM
Thanks Allan!