Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Quick start?
08-02-2013, 09:08 AM
Post: #21
RE: Quick start?
I'm still encountering one error:

Quote:System.AccessViolationException occurred
Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source=ohNet.net
StackTrace:
at OpenHome.Net.Device.DvDevice.DvDeviceSetEnabled(IntPtr aDevice)
at OpenHome.Net.Device.DvDevice.SetEnabled()
at Hoster.OhNetHoster.Start() in C:\Users\jgro\Desktop\UpnpTest\Hoster\OhNetHoster.cs:line 36
InnerException:

)I've made a very small test project, which should just host one device with one service(action): https://dl.dropbox.com/u/368403/Work/UpnpTest.zip

But it crash with the previous exception, maybe you have a clue on what is going wrong here?
Find all posts by this user
08-02-2013, 09:34 AM (This post was last modified: 08-02-2013 09:34 AM by simonc.)
Post: #22
RE: Quick start?
(08-02-2013 09:08 AM)J4N Wrote:  I'm still encountering one error:

[snip]
)I've made a very small test project, which should just host one device with one service(action): https://dl.dropbox.com/u/368403/Work/UpnpTest.zip

But it crash with the previous exception, maybe you have a clue on what is going wrong here?

Thanks, the sample code made this easy to diagnose.

You need to set a few more attributes when you create your device:

Code:
m_device.SetAttribute("Upnp.Domain", "test.com");
m_device.SetAttribute("Upnp.Type", "XmsService");
m_device.SetAttribute("Upnp.Version", "1");

With these changes, the device is published successfully for me.

Note that your OhNetHoster.Dispose() method isn't quite right either. It should be

Code:
if (m_device != null) m_device.Dispose();
if (m_provider != null) m_provider.Dispose();
if (m_library != null) m_library.Dispose();
Find all posts by this user
08-02-2013, 09:51 AM
Post: #23
RE: Quick start?
Thank you very much for your fast response!
It seems to works now!! I'm really happy, thank you some much for the help, I still need to do some more tests, but seems great!

Thank you a lot for your help, I cannot manage to do it without you

Some additionals questions:
1. I'm not sure to understand why we have to specify those three informations on the device and in the Provider?
2. Disposing the device automatically unregister it?
3. Not directly related to OhNet, but you may be able to give me a hint: I've played with the MS UPnP library, and when the application crashed(or I stopped the execution), I got some ghost device, and I've no idea how I can remove them, any idea? They stay even if I reboot, since several days
Find all posts by this user
08-02-2013, 10:13 AM
Post: #24
RE: Quick start?
(08-02-2013 09:51 AM)J4N Wrote:  Thank you very much for your fast response!
It seems to works now!! I'm really happy, thank you some much for the help, I still need to do some more tests, but seems great!

Thank you a lot for your help, I cannot manage to do it without you

Glad you've got things up and running! Feel free to keep coming back with questions. If the questions are about different areas of the library, could you please consider posting them as separate threads.

(08-02-2013 09:51 AM)J4N Wrote:  Some additionals questions:
1. I'm not sure to understand why we have to specify those three informations on the device and in the Provider?

It probably isn't used very often but allows a device to publish services that were defined by a number of different vendors. For example, a media server would have domain upnp.org but is allowed to include vendor-specific services which would have different domains.

(08-02-2013 09:51 AM)J4N Wrote:  2. Disposing the device automatically unregister it?

Yes. A device is disabled as part of its disposal. You can safely call Dispose() on a device regardless of whether it is enabled or disabled.

(08-02-2013 09:51 AM)J4N Wrote:  3. Not directly related to OhNet, but you may be able to give me a hint: I've played with the MS UPnP library, and when the application crashed(or I stopped the execution), I got some ghost device, and I've no idea how I can remove them, any idea? They stay even if I reboot, since several days

Sorry, I haven't come across this before. A question on StackOverflow might attract some better informed response...
Find all posts by this user
08-02-2013, 12:58 PM
Post: #25
RE: Quick start?
Ok thank you! I've another small question, but I will create another topic Smile
Find all posts by this user


Forum Jump: