Hi together!
I am working on Bluetooth component for the vvvv-platform. I have already successfully implemented a BT scanner for detecting available BT nodes.
Now, the next step is the implementation of a OBEX (ObjectExchange protocol) receiver. Thus, the component is implemented as a listener which I want to run in an own thread…
There is the problem: I use the following (pseudo)-code:
{CODE(ln=>1)}Thread thread = new Thread(new ThreadStart(runThread));
thread.Start();^
and the runThread-method is implemented like the following:
{CODE(ln=>1)}private void runThread() {
try {
while (listener.IsListening) {
ObexListenerContext olc = listener.GetContext();
ObexListenerRequest olr = olc.Request;
string filename = olr.RawUrl.Replace("/","").Replace("%EF%BF%BD","");
olr.WriteFile(“c:\”+filename);
}
}
catch (Exception e){}
}^
This works fine for a singular object exchange. The file is properly stored on the given location in the filesystem. But at the same moment vvvv aborts with an “unknown” exception.
Does anybody made experiences with threaded plugin development?
Thanks & regards,
salocinx.