starting Windows service again on exception..
-
i have a windows service and when any exceptions occur then its stopping... is there any way to restart that service automatically when it is stopped...
-
i have a windows service and when any exceptions occur then its stopping... is there any way to restart that service automatically when it is stopped...
-
1. prob not the best forum 2. 5 seconds of my time found an answer on google Here is the work you could not be bothered to do yourself[^]
Life goes very fast. Tomorrow, today is already yesterday.
thans for that.. but is the code in the public override onstop() { //progie code } will this function execute when the service is stopped due to abnormal execution such as exception....
-
thans for that.. but is the code in the public override onstop() { //progie code } will this function execute when the service is stopped due to abnormal execution such as exception....
It is unlikely that any event will fire when you get an exception. Your best bet would be to handle an errors and exceptions so your service does not crash. I dont really want to suggest putting the whole service in one try/catch block and doing some restarting code in that but its your choice what approach you take
Life goes very fast. Tomorrow, today is already yesterday.
-
It is unlikely that any event will fire when you get an exception. Your best bet would be to handle an errors and exceptions so your service does not crash. I dont really want to suggest putting the whole service in one try/catch block and doing some restarting code in that but its your choice what approach you take
Life goes very fast. Tomorrow, today is already yesterday.
ok... if you are free can u tell will the service crash when the exception eccurs in the service...and i am sending the data from systems on the network to the service. and when the number of clients get more i get the exception "The IAsyncResult object was not returned" at the client side and insted of client crashing my service crashes....can i get some help with this...
-
ok... if you are free can u tell will the service crash when the exception eccurs in the service...and i am sending the data from systems on the network to the service. and when the number of clients get more i get the exception "The IAsyncResult object was not returned" at the client side and insted of client crashing my service crashes....can i get some help with this...
Im afraid i can not give you any detailed help on this subject but it appears that you have a problem handling your connections in your service. the service should ideally receive a request for a connection, check anything that may stop it using a new connection, and then report back to the client with a success/fail message in regards to the connection request. EDIT:
max.4u wrote:
will the service crash when the exception eccurs in the service...
Yes the service will crash just like any application would if an unhandled exception is thrown
Life goes very fast. Tomorrow, today is already yesterday.
-
Im afraid i can not give you any detailed help on this subject but it appears that you have a problem handling your connections in your service. the service should ideally receive a request for a connection, check anything that may stop it using a new connection, and then report back to the client with a success/fail message in regards to the connection request. EDIT:
max.4u wrote:
will the service crash when the exception eccurs in the service...
Yes the service will crash just like any application would if an unhandled exception is thrown
Life goes very fast. Tomorrow, today is already yesterday.
its ok... i wil once again review my code in the service... and do u know whats the maximum number of connections the tcp listener can handle without queing....?
-
its ok... i wil once again review my code in the service... and do u know whats the maximum number of connections the tcp listener can handle without queing....?
-
thanks... and if i am not bothering you.... when i create a tcp socket and connect to the server and when the connection is established then is it regarded as the tcp connection or a socket connection..?
-
thanks... and if i am not bothering you.... when i create a tcp socket and connect to the server and when the connection is established then is it regarded as the tcp connection or a socket connection..?