So i have a service that i created that checks in with a server every x mins and receives a reply from it. The reply is either a sleep or command. receiving a scan command the service packs up and Tars a load of files and sends them off to the server. During Debug mode my app runs perfectly fine. I can step through the code and everything is being triggered as it should and the communication between client and server is perfectly fine.
However. Upon deployment of my service, it will crash upon receiving a scan command. I have looked at the windows Event Viewer and found this:
Application: Client.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info:
System.Net.WebException Stack: at
System.Net.FtpWebRequest.GetRequestStream() at
tcpClient.ftpClass.upload(System.String, System.String) at
Client.Service1.checkInCycle(System.String) at
Client.Service1.Callback(System.Object) at
System.Threading.TimerQueueTimer.CallCallbackInContext(System.Object) at
System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext,
System.Threading.ContextCallback, System.Object, Boolean) at
System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,
System.Threading.ContextCallback, System.Object, Boolean) at
System.Threading.TimerQueueTimer.CallCallback() at
System.Threading.TimerQueueTimer.Fire() at
System.Threading.TimerQueue.FireNextTimers() at
System.Threading.TimerQueue.AppDomainTimerCallback()
The only possible point of failure i can think of in FTPWebRequest is the timeoutVal, but i have changed this to infinite using:
request.Timeout = -1;
So any ideas as to why this is happening ?