LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-25-2006, 05:06 AM   #1
emarri
LQ Newbie
 
Registered: Mar 2006
Posts: 11

Rep: Reputation: 0
broadcast (udp) socket - multi processes


hi all
I am currently working on an application that spawns several other processes and on all of them I have a udp socket listening for either broadcast messages or direct messages.
I have created a small protocol such that I can address each running process (simple identification) on the same host, so I can either broadcast some messages or send directly to the host. All messages are received by the socket on each processes running on the host but only the ones that have registered for the incoming message will further process the message.

Hope that is quite clear what I'm trying to explain here.

The problem is that when I use direct IP addresses (192.168.10.10 instead of 192.168.10.255) the message is not being received to all sockets on the the running processes.
For example:

- Process A spawns -> B
- When a message targeted both for A and B is being sent using direct IP, only the B process receives the message on the udp socket.
- When a message is being sent using broadcast IP all processes are receiving the message on the udp socket.

The sockets are configured using setsockopt() with both SO_REUSEADDR and SO_BROADCAST.

Hope you can assist me in this or give me some hints on where the problem might be.

regards
Marri
 
Old 09-25-2006, 06:06 AM   #2
emarri
LQ Newbie
 
Registered: Mar 2006
Posts: 11

Original Poster
Rep: Reputation: 0
It seems so that the last process being spawned always gets the attention of the socket. Is it so that ports can't be shared when using unicast and only in broadcast cases the ports can be shared?
Is there any way around this other then implementing multicast sockets?

regards
Einar
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Poll() and UDP socket krizzz Programming 4 06-06-2006 10:55 AM
Why Does a Broadcast on a Raw Socket get echoed back to me? btn_paragon Programming 5 09-09-2005 07:32 AM
udp broadcast from one subnet to another thru a linux router siva_bhavani Linux - Networking 1 12-30-2004 10:20 AM
How to receive UDP and ICMP packets, by one UDP socket(PMTUD) myself_rajat Linux - Networking 0 05-28-2004 05:43 AM
how to broadcast UDP datagrams sokar Programming 2 02-14-2004 05:37 PM


All times are GMT -5. The time now is 06:00 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration