Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9251855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:48:16+00:00 2026-06-18T10:48:16+00:00

Requirements (Can not be modified) I have a windows forms application. When this application

  • 0

Requirements
(Can not be modified)

I have a windows forms application. When this application runs, it listen to a UDP port.

Users can loggin to windows and open the same application and run it, and then switch windows user without logging out and open the same application and run it.

Problem

The two applications are listening to the same port by using

SocketOptionName.ReuseAddress

as shown in this thread. But only one can get the data.

Question

There is some way so that the application of another user can read the data?. otherwise, can I listen somehow an event that notifies me about the windows user switch?

Edit

Here is the code used for setting up the listener

IPEndPoint localEndPoint = new IPEndPoint(localAddress, listenPort);
UdpClient udpListener = new UdpClient();
udpListener.ExclusiveAddressUse = false;
udpListener.Client.SetSocketOption(SocketOptionLevel.Socket,SocketOptionName.ReuseAddress, true);

udpListener.Client.Bind(localEndPoint);
IPEndPoint ep = new IPEndPoint(IPAddress.Any, 0);
byte[] answer = udpListener.Receive(ref ep);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T10:48:17+00:00Added an answer on June 18, 2026 at 10:48 am

    One option is to switch to a broadcast/multicast design. This is the only direct way to allow the very same datagram to go to more than one socket.

    Alternatively, go to a master/client design. Try to bind to the port. If you can, great, you’re the master. If you fail, see if there’s a master and connect to it.

    Pick a second port for the master to use to communicate with clients. Follow this logic.

    1. Try to open the port. If you succeed, you are the master. Also listen on the master port.

    2. If you fail, open a random port. Send a “register client” datagram to the master.

    3. The master must listen for “register client” datagrams on the master/client port. If it receives one, it should add the source IP and port to its list of clients. It must repeat all datagrams it receives on the main port to each of its clients.

    4. Non-masters should repeat “register client” datagrams at a defined interval. The master should drop any client that hasn’t sent a “register client” datagram in sufficiently long, say twice the defined interval.

    One ugly bit — if the master might quit, some client will have to promote itself to master. You may just want to go with a dedicated master if you can run it on the machine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Requirements : I have a table of several thousand questions. Users can view these
using rails 3.2.8, I have an application where users can sign in and out,
I'm setting up a Magento site and have some design requirements that we can't
Can someone recommend a hosted solution that answers the following requirements (I have seen
I have some credential requirements for my modules in security.yml. How can i run
How can I have an accessible read only checkbox in Silverlight? The accessibility requirements
i have a script that i have modified to meet my requirements however i
I have this java application and ran into a requirement to parse an STDF.
Short question: Can anyone tell me what the requirements (especially when it comes to
First the requirements: By management requirements, I can't use open source code. I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.