Windows Service
-
I am currently integrating a correctly running windows service and a win32 application into a windows service which will listening to certain sockets with specified port. Individually, both of them works fine. When i replace the endlessloop of the windows service with a segment of code which creates a socket instance, the service failed to start. Can anybody explain to me the reason or suggest some rational modification that i should make to solve the problem... Thanks for any help in advance!
-
I am currently integrating a correctly running windows service and a win32 application into a windows service which will listening to certain sockets with specified port. Individually, both of them works fine. When i replace the endlessloop of the windows service with a segment of code which creates a socket instance, the service failed to start. Can anybody explain to me the reason or suggest some rational modification that i should make to solve the problem... Thanks for any help in advance!
zhaopi wrote: When i replace the endlessloop of the windows service with a segment of code which creates a socket instance, the service failed to start. What does "failed to start" means exactly? zhaopi wrote: Can anybody explain to me the reason or suggest some rational modification that i should make to solve the problem... It's hard to do that with the info you provide. Perhaps if you give more details about the error and post a code snippet showing what you are doing, someone may suggest something useful. -- jlr http://jlamas.blogspot.com/[^]
-
I am currently integrating a correctly running windows service and a win32 application into a windows service which will listening to certain sockets with specified port. Individually, both of them works fine. When i replace the endlessloop of the windows service with a segment of code which creates a socket instance, the service failed to start. Can anybody explain to me the reason or suggest some rational modification that i should make to solve the problem... Thanks for any help in advance!
Do you do any logging of the service startup and your own code ? If the service was working before you added your code, then obviously its something in the socket init sequence thats doing it - so you need to put logging steps around this area of your code - did you test the code that creates the socket instance OUTSIDE the service ?? its easier to test such things from a standalone exe first, THEN add them to a service (imho) Either way, you should be using the Application Event log (judiciously) and other logging methods when you're in the service. 'G'
-
zhaopi wrote: When i replace the endlessloop of the windows service with a segment of code which creates a socket instance, the service failed to start. What does "failed to start" means exactly? zhaopi wrote: Can anybody explain to me the reason or suggest some rational modification that i should make to solve the problem... It's hard to do that with the info you provide. Perhaps if you give more details about the error and post a code snippet showing what you are doing, someone may suggest something useful. -- jlr http://jlamas.blogspot.com/[^]
Heck - I like your answer better than mine (see below) - we must have been sending a response at roughly the same time .. 'G'
-
Heck - I like your answer better than mine (see below) - we must have been sending a response at roughly the same time .. 'G'
Garth J Lancaster wrote: Heck - I like your answer better than mine (see below) I don't think mine is better. I think they complement each other. :) Cheers, -- jlr http://jlamas.blogspot.com/[^]
-
I am currently integrating a correctly running windows service and a win32 application into a windows service which will listening to certain sockets with specified port. Individually, both of them works fine. When i replace the endlessloop of the windows service with a segment of code which creates a socket instance, the service failed to start. Can anybody explain to me the reason or suggest some rational modification that i should make to solve the problem... Thanks for any help in advance!