473,386 Members | 1,793 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

UDP Broadcast Receive

I'm going around in circles here and need some help.

Scenario: I am using (have used) either the UDPClient class or Sockets
class to broadcast some bytes to 255.255.255.255 (udp protocol). Upon doing
so, a device (of which I will know nothing about) will receive my broadcast
and send out a broadcast of its own. Using Ethereal (LAN packet sniffer), I
can see my broadcast, and I can see the device broadcast. I cannot however
receive the broadcast with my VB.NET code.

I have tried the same Socket object for the send and receive, and I have
tried different Socket objects for the send and receive. The send always
works great, but the receive just sits there like a bump on a log.

Does anyone have a code example for RECEIVING A BROADCAST MESSAGE.

Thanks!

Nov 21 '05 #1
7 12232
Try this one:

http://www.thecodeproject.com/useritems/TinyUDP.asp
"Shawn G." <Sh****@discussions.microsoft.com> wrote in message
news:18**********************************@microsof t.com...
I'm going around in circles here and need some help.

Scenario: I am using (have used) either the UDPClient class or Sockets
class to broadcast some bytes to 255.255.255.255 (udp protocol). Upon
doing
so, a device (of which I will know nothing about) will receive my
broadcast
and send out a broadcast of its own. Using Ethereal (LAN packet sniffer),
I
can see my broadcast, and I can see the device broadcast. I cannot
however
receive the broadcast with my VB.NET code.

I have tried the same Socket object for the send and receive, and I have
tried different Socket objects for the send and receive. The send always
works great, but the receive just sits there like a bump on a log.

Does anyone have a code example for RECEIVING A BROADCAST MESSAGE.

Thanks!

Nov 21 '05 #2
well i just recently had to make a client server discoverer

i found some code here and some code there put it all together in a nice
broadcast and receiver class

it works flawless and is verry simple code ( easy to understand )

if you are interested i can send them to you ,,,, as i do not believe that i
can post binary`s in this newsgroup

regards

Michel; Posseth [MCP]

"Shawn G." <Sh****@discussions.microsoft.com> schreef in bericht
news:18**********************************@microsof t.com...
I'm going around in circles here and need some help.

Scenario: I am using (have used) either the UDPClient class or Sockets
class to broadcast some bytes to 255.255.255.255 (udp protocol). Upon
doing
so, a device (of which I will know nothing about) will receive my
broadcast
and send out a broadcast of its own. Using Ethereal (LAN packet sniffer),
I
can see my broadcast, and I can see the device broadcast. I cannot
however
receive the broadcast with my VB.NET code.

I have tried the same Socket object for the send and receive, and I have
tried different Socket objects for the send and receive. The send always
works great, but the receive just sits there like a bump on a log.

Does anyone have a code example for RECEIVING A BROADCAST MESSAGE.

Thanks!

Nov 21 '05 #3
"=?Utf-8?B?U2hhd24gRy4=?=" <Sh****@discussions.microsoft.com> wrote in
news:18**********************************@microsof t.com:
Does anyone have a code example for RECEIVING A BROADCAST MESSAGE.


http://www.codeproject.com/dotnet/RBSOD.asp
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Get your ASP.NET in gear with IntraWeb!
http://www.atozed.com/IntraWeb/
Nov 21 '05 #4
"=?Utf-8?B?U2hhd24gRy4=?=" <Sh****@discussions.microsoft.com> wrote in
news:18**********************************@microsof t.com:
Does anyone have a code example for RECEIVING A BROADCAST MESSAGE.


http://www.codeproject.com/dotnet/RBSOD.asp
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Get your ASP.NET in gear with IntraWeb!
http://www.atozed.com/IntraWeb/
Nov 21 '05 #5
Ultra Network Sniffer is best one.
http://www.download.com/Ultra-Networ...ml?tag=lst-0-1

Nov 21 '05 #6
Well guys. No luck yet. Here may be some more useful info. The device
broadcasts its response back on the same port number that the initial
broadcast on my PC was sent from. Therefore, I MUST be listening on the port
that I sent from.

I cannot change the device broadcast port number, as this is a 3rd party
device that I have no access to. The code examples work great for listening
to the original broadcast on some port number, but don't work when the send
port and listen port need to be the same.
Nov 21 '05 #7
I should have tried my last test before sending my previous response. I got
side tracked while investigating the Socket option ReuseAddress. Setting
this option to true on my Sender Socket allows me to have my Send and Receive
objects using the same port. Program works like a champ now.

Thank you guys for the responses.
Nov 21 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Steve | last post by:
Please take a look at the simple code segment below and advise me what is wrong. According to the help and examples I've seen it should work unless I misunderstand something. The problem is...
6
by: pekspro | last post by:
I need some code that gets the address from a server. I read somewhere that you could do this by starting some broadcast server using UDP. The client should send an broadcast message, and when the...
8
by: Frank Esser | last post by:
Hello! I have got machines that answer a certain UDP broadcast request with certain information about them. Some years ago I wrote a VB6 application that just sent out this UDP broadcast...
2
by: Shawn G. | last post by:
I'm going around in circles here and need some help. Scenario: I am using (have used) either the UDPClient class or Sockets class to broadcast some bytes to 255.255.255.255 (udp protocol). Upon...
2
by: Daniel Lindberg | last post by:
Hi, im a beginner in C# and i just cant seem to get my udp broadcasting to work. What happens is that it just locks down on the Receive call and never gets any data. I have the code for the server...
3
by: greenxiar | last post by:
My Computer is Win2K3 R2, Code is: using System; using System.Net; using System.Net.Sockets; using System.Threading; namespace TechUDPBroadcast { class Program { static void Main(string...
9
by: Irmen de Jong | last post by:
Hello Sorry this might be a bit offtopic but I don't really know where else to post this question. If you could point me in the right direction that is much appreciated. I'm running into a...
0
by: riaancillie | last post by:
I apologize in advance since this isn't strictly the most appropriate group to ask this question in. I am using a Socket to broadcast UDP datagrams as such: FSocket.EnableBroadcast = true;...
2
by: OBones | last post by:
Hi all, I'm currently trying to receive replies to a UDP broadcast that I sent and I can't get it to work. I know the datagrams are sent as I see them with WireShark, but my C# code does not see...
1
by: raviskar | last post by:
Hi, I have a problem in receiving UDP broadcast data. We have a simple application which listens for the UDP broadcast data from the external servers. We can receive the UDP broadcast data from...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.