Issues with running application as a .NET service

7 posts / 0 new
Last post
Offline
Last seen: 10 years 6 months ago
Joined: 05/29/2014
Posts: 2
Issues with running application as a .NET service

We have written a small test case where we are subscribing to a specific message using C# in a publish-subscribe mechanism.

When running as a console application as a standard executable, there are no issues with communication however when running as a windows service, there are a number of persistent issues: -

1. Occasionally, when viewing with RTI Analyzer, the subscriber, on the service, is not visible

2. Publication, sent from the publishing application, not received by the subscriber, on the service, at any time

We have oberserved the following post, http://community.rti.com/kb/why-doesnt-my-rti-connext-application-communicate-rti-connext-application-installed-windows, however this does not seem to have the exact same symptoms. Never-the-less, we ran the service with the same username as the executable running the publishing application. Unfortunately this did not resolve the issue.

Any advice would be welcome.

Many Thanks!

Offline
Last seen: 3 years 9 months ago
Joined: 01/15/2013
Posts: 94

Hi,

Windows Services are usually run on a very strong security context. This could limit the access to the network and other remote resources (remote - understood as non-local resources like memory, disk or CPU). How are you setting up your service to run, under what type account and/or hardware profile?

Also, I would like to know what version of RTI Connext and .NET you are using, and the types you're trying to publish (a high-level description could suffice if you don't want to share them).

Thanks,

Juanlu

Offline
Last seen: 10 years 6 months ago
Joined: 05/29/2014
Posts: 2

Hello Juan,

We have run the service as a user with administrator privileges, local service, network service and local system but unfortunately this didn't resolve the issue.

The version of RTI Connext is 4.5f and the version of .NET is 4.0

The types that we are using are as follows (modified slightly for security purposes): -

 struct fileRequest { string id; //@key string filename; };
struct fileResult { string id; //@key string errorMessage; };

As you can see, these types are very simple and our code works when run as a console application. There are also no DDS exceptions or error codes thrown, nor does the log identify anything out of the norm. Using the trace tool, we can see that the data just isn't published nor is any data received from the subscriptions made.

Thanks!

Offline
Last seen: 3 years 9 months ago
Joined: 01/15/2013
Posts: 94

Hi,

I see, when you say you have used the "trace" tool, are you talking about RTI DDS Spy? Are both the Publisher and the Subscriber run as Windows services? It may be a discovery issue. Are you using any non-default QoS values?

It would be very useful if you could provide the project so I can take a look at it and see if I can spot anything strange.

Thanks!

Juanlu

Offline
Last seen: 10 years 2 months ago
Joined: 01/29/2013
Posts: 4

Another thing to be aware of: since you are trying to communicate to and from a Windows Service, it will not be possible to use shared memory as a transport. Did you remove shared memory completely from the transport? This means that you should remove the SHMEM flag from the builtin transport settings. Let me know if you need any help with that.

Note that your Windows Service will still be able to communicate with processes on the same machine over local loopback.

Offline
Last seen: 3 years 9 months ago
Joined: 01/15/2013
Posts: 94

Hi,

Are you observing messages of type "can't reach locator..." (http://community.rti.com/kb/what-does-cant-reach-locator-error-message-mean)

Thanks,

Juanlu

Offline
Last seen: 3 years 9 months ago
Joined: 01/15/2013
Posts: 94