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);