If you are using VB.NET or C# you can use a property in the UdpClient class that lets several programs on the same computer listen to the same UDP port.
Something like this:
C#:
Code: Select all
IPEndPoint localpt = new IPEndPoint(IPAddress.Any, 6000);
UdpClient udpServer2 = new UdpClient();
udpServer2.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
udpServer2.Client.Bind(localpt);
VB.NET:
Code: Select all
Dim udpListener New UdpClient()
udpListener .ExclusiveAddressUse = False
udpListener .Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, True)
Dim LocalIpEndPoint As New System.Net.IPEndPoint(System.Net.IPAddress.Any, 0)
udpListener.Client.Bind(LocalIpEndPoint)
I don't recall if both programs has to use code similar to the example above or if it works if only one program do it.
I think it works like this if only one program has the ReuseAddress code: Your program with the ReuseAddress must listen to the udp port first, before the other program starts listening on the port. If another program starts to listen to the UDP port without doing something like the code above then you will not be able to open the port in your program even if you use the above code.
I only knows how to do it in .NET. I guess other program languages may have something similar depending on the language. You can read more about it here:
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
Disclaimer: I have not used this to receive OSC data but I have used this technique in other applications where you have one program sending out data on a port and another program is receiving the data on the same port on the same computer.