 |
two OSC related questions
Started by bill56 at 03-02-2010 10:46. Topic has 2 replies.
|
|
03-02-2010, 10:46
|
bill56
Joined on 03-02-2010
Posts 2
|
two OSC related questions
|
|
|
|
|
Hallo I am using Ventuz.OSC and I hope you could help me with two things I cant figure out.
1) Im using the same aplication multiple times and i would like to us a "'." in the adress space to indicate the fact that they are simular(like an instance) this has become a standerised way within some parts of the OSC comunity.
So I would like to use /mycam.1/gain or /mycam.2/gain
instaid of /mycam/1/gain ..
As i now understand it the "."in a adress space name is not regarded legitemate by Ventuz.OSC, and there for an error is returned. My first question is, Is there any way to bypase this error generation. It may seem just a cosmetic issue but i would like to use the Ventuz.OSC dll in a pilot project for art conservation and that would be using the "." in the adress space to indicate instances of objects.
The second questions relates to using multiple OSCreaders on the same computer(ip) binding to the same port number.
Like multiple readers joining a group or in any other way. I need to use a single command port number and have the OSCclients all listen to this port.
This is extreemly convenient for passing general commmands and responces.
Thanks for Ventuz.OSC and thanks for your time.
Have a nice day greetings Bill
|
|
|
|
|
Report
|
|
|
|
03-02-2010, 16:48
|
Ralf Stanke

Joined on 05-15-2005
Hamburg, Germany
Posts 569
|
Re: two OSC related questions
|
|
|
|
|
Hi Bill,
first, you can't bypass the address validation in Ventuz.OSC, because the dot is against the naming convention of OSC. We designed that library to be 100% compatible to the OSC standard.
second, IP networks do not allow to multiple processes listening to the same IP end point (IP+Port). The Windows (or any other) kernel throws an error if you try to open an listening socket on an already assigned end point. no way around!
if all your desired listeners are all located in the same process, you could develop your own dispatcher to dispatch the receives message to several parts of you program. Only you can know where and how to dispatch that message... Another solution could be to use our OscDispatcher. You register the UdpReader to it and all program parts can register the message event to it. If you know purge the dispatcher, all your receiver get notified, retrieving the same message.
Ralf
|
|
|
|
|
Report
|
|
|
|
03-02-2010, 20:58
|
bill56
Joined on 03-02-2010
Posts 2
|
Re: two OSC related questions
|
|
|
|
|
Hi Ralf,
thanks for your quick responce and your proposed solution.
Unfortunatly the listeners run in many seperated programs. But the good news is that there is a way to create multiple listeners. a short quote from a article I found about this item on the web start quote" by default you can have only one instance bind the same port. To bind multiple sockets to the same port number, you need to specify the socket option ReuseAddress and also do not use the constructor here. =============================
try
{
IPEndPoint localpt = new
IPEndPoint(IPAddress.Parse("127.0.0.1"),Int32.Parse(txtPort.Text));
UdpClient udpServer = new UdpClient();
udpServer.Client.SetSocketOption(SocketOptionLevel.Socket,
SocketOptionName.ReuseAddress, true);
udpServer.Client.Bind(localpt);
MessageBox.Show("OK");
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
"
End of quote. I implemented this methode in bespoke.osc and it worked. I just happen to like Ventuz.OSC since it really is a very easy to use and a rich implementation of OSC. I dont know how to set the socket option in the Ventuz dll and likely thats not a option at this time.
Still I hope you find this info to your interst to as it opens up the posibility for a dedicated port for general commands.
As for the "." I realize its not much used but as of my understanding it is a valid ASCI character according to the OSC standard.
Start quote"
Each OSC Method and each OSC Container other than the root of the tree has a symbolic name, an ASCII string consiting of printable characters other than the following:
character name ASCII code (decimal)
' ' space 32
# number sign 35
* asterisk 42
, comma 44
/ forward slash 47
? question mark 63
[ open bracket 91
] close bracket 93
{ open curly brace 123
} close curly brace 125
List of printable ASCII characters not allowed in names of OSC Methods or OSC Containers
"
end quote.
I realise at this time i am probably the only .net user that is keen on a "." because of wanted compatibility with the Jamoma osc protocol which I intend to introduce as an standard way to communicate between modules made for the conservation of existing media art installations. It is the intension for these modules to be freely available and hopefully they will be used for the development of future art works as well.
Im am realy verry happy about the fact that Ventuz is so kind towards the community to share there Ventuz.OSC !!!! it sure fills a need because there aren't many OSC .net solutions. Hope you are intersted in multiple listeners to the same port and can throw in a "."
Thanks for Ventuz.OSC and your time, have a nice day.
Kind regards Bill
|
|
|
|
|
Report
|
|
|
|
|
 |