473,385 Members | 1,772 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,385 software developers and data experts.

Passive bind/listen for UDPClient?

I want to bind multiple UDPClients to the same port on the same machine. I
want them to all listen for broadcast messages & respond accordingly.

Multiple client bindings "under normal circumstances" doesn't work (That's
the error I am getting).

But, it seems very reasonable to set up many UDPclients to receive the same
broadcast messages off the same port on the same machine.

Is there some way to passively bind multiple UDPclients to the same port on
the same machine?

Is there some lower level socket class I can use to catch these messages?

In general, this is my current approach:

http://www.ondotnet.com/pub/a/dotnet...html?page=last
Named pipes would probably be a perfect fit for this, but I haven't seen any
good approaches for named pipes that are as lean as UDP.
Feb 20 '06 #1
1 3379
Ok, I got it.

I cant seem to get the UDPClient class to do this directly, so this seems to
be working:
udpClient = New Socket(AddressFamily.InterNetwork, SocketType.Dgram,
ProtocolType.Udp)
Dim RemoteIpEndPoint As New IPEndPoint(IPAddress.Any, MyListenPort)
Dim myGroup As IPAddress
myGroup = IPAddress.Parse(MyListenIP)

'Reusing the address should let multiple clients listen to the same Port
udpClient.SetSocketOption(SocketOptionLevel.Socket ,
SocketOptionName.ReuseAddress, 1)
udpClient.Bind(RemoteIpEndPoint)
udpClient.SetSocketOption(SocketOptionLevel.IP,
SocketOptionName.AddMembership, New MulticastOption(myGroup, IPAddress.Any))
"gregory_may" <None> wrote in message
news:Oh**************@TK2MSFTNGP10.phx.gbl...
I want to bind multiple UDPClients to the same port on the same machine. I
want them to all listen for broadcast messages & respond accordingly.

Multiple client bindings "under normal circumstances" doesn't work (That's
the error I am getting).

But, it seems very reasonable to set up many UDPclients to receive the
same broadcast messages off the same port on the same machine.

Is there some way to passively bind multiple UDPclients to the same port
on the same machine?

Is there some lower level socket class I can use to catch these messages?

In general, this is my current approach:

http://www.ondotnet.com/pub/a/dotnet...html?page=last
Named pipes would probably be a perfect fit for this, but I haven't seen
any good approaches for named pipes that are as lean as UDP.

Feb 21 '06 #2

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

Similar topics

2
by: Martin Robins | last post by:
I know this is not really the right forum for this topic, but I figured there are a lot of people here who may be able to provide me with an answer to my question so I would give it a try. About...
2
by: goodmannewz | last post by:
I just cannot run the sample code from msdn. Please tell me why? Thanks a lot. I create a console C# project, parsed the example codes: public class UDPMulticastListener { private static...
1
by: HABJAN ®iga | last post by:
Hello, how can i bind a socket for listen on some port, and all addresses : In the sample i bind myself to localhost(127.0.0.1) on port 5500. It works fine when connecting to localhost, but if...
2
by: Emilio | last post by:
Question about UdpClient sample ' This constructor arbitrarily assigns the local port number. Dim udpClient As New UdpClient() Try udpClient.Connect("www.contoso.com", 11000) ' Sends a...
3
by: D. André Dhondt | last post by:
In VB.NET 2003, is there a way to create a System.Net.Sockets.UDPClient to listen to any address AND any port? I can get it to listen to any address, but only if I specify a port (for example,...
1
by: Marcelo | last post by:
_____ From: Marcelo Posted At: Friday, September 30, 2005 1:40 PM Posted To: microsoft.public.dotnet.languages.vb Conversation: Subject: Client and Server - Listen por packets in a specific...
14
by: DaTurk | last post by:
I am makeing a Multicast server client setup and was wondering what the difference is between Socket.Connect, and Socket.Bind. It may be a stupid question, but I was just curious. Because I...
0
by: tccode97 | last post by:
To whom it may concern, I am developing a socket application in VC++ that uses asynchronous connnection. After doing search on google, I found the following link ...
1
by: tccode97 | last post by:
Hi, I need an urgent help. I am developing a socket application in VC++ that uses asynchronous connnection. After doing search on google, I found the following link ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.