views:

26

answers:

1

Hello,
i have two questions:

  1. can windows services register to receive SENS network events because my service just stops when i try to do it.
  2. after the service onStart() method has been called, if no seperate Timer or thread is started, does the service stop ??

NOTE: i am using C# services to implement my service

thanx, AB

+1  A: 
  1. You should be able to, I'm not real familiar with SENS specifically but you should be able to do just about anything (outside of UI related, and that's doable too just more caveats). One thing you might want to check out is what user account your service is running, you may need to use something like LocalServie or LocalSystem to have the proper permissions.

  2. No the process continues to run, but if you don't have a timer or some other mechanism to invoke your code, then your service won't do anything.

Coding Gorilla
thank you, thank you, thank you. it was the security problem, i recall that i did notice it once but i cant figure out how, and by the way, why the program just throws an exception instead of crashing or stoping .., any idea ??
Ebraheem Najjar
Probably becuase the ServiceBase class tries to handle the exceptions gracefully so as not to cause problems with the SCM or other services.
Coding Gorilla