Community forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


edfscott
2016-02-29T17:50:10Z
Is there a way to speed up the exit of a console application using the c# api? If all I do is connect then disconnect it takes around 45 seconds for the console application to exit. I have tried directly calling dispose but its not helping. The VisualCronClient.exe disappears right away so I believe its possible for a quit exit.

static void Demo()
{

var conn = new VisualCronAPI.Connection
{
Address = "XXXXX",
UserName = "XXXXX",
PassWord = "XXXXX",
Port = 16444,
ClientType = VisualCron.ClientConnectionClass.ClientT.APIClient,
ClientVersion = "1.0",
ConnectionType = VisualCronAPI.Connection.ConnectionT.Remote,
ConnType = CommClientCore.Enums.ServiceType.SignalRService,
UseCompression = true
};
using (var client = new VisualCronAPI.Client())
{
using (var server = client.Connect(conn))
{
server.Disconnect();
client.DisconnectAll();
server.Dispose();
client.Dispose();
}
}

}
Sponsor
Forum information
Support
2016-02-29T18:31:25Z
Please do not set these:

ClientVersion = "1.0",
ConnType = CommClientCore.Enums.ServiceType.SignalRService,
UseCompression = true


1. what is the goal - how do you use it?
2. do you need to connect remotely?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
edfscott
2016-02-29T19:14:59Z
I am using the console application to run a job with customized job variables. We have a separate tool that controls workflow and scheduling. VisualCron is being leveraged to run some tasks the workflow tool does not excel at. The workflow tool will call into VisualCron with a set of parameters for the current workflow. I am writing to the VisualCron api to run the specific job with those parameters to a job applied and return the result to the workflow tool.

I removed those settings, switched it to local and ran the application on the server. It still takes 45 seconds to exit. I removed the code where I call the job to simplify the example.

Here is an updated sample: I you compile this as a console app and run it, the console app will take over 45 seconds to close.
private static void Main(string[] args)
{
var conn = new VisualCronAPI.Connection
{
Address = "localhost",
UseADLogon = true,
Port = 16444,
ClientType = VisualCron.ClientConnectionClass.ClientT.APIClient,
ConnectionType = VisualCronAPI.Connection.ConnectionT.Local
};
using (var client = new VisualCronAPI.Client())
{
using (var server = client.Connect(conn))
{
server.Disconnect();
client.DisconnectAll();
server.Dispose();
client.Dispose();
}
}
}
Support
2016-02-29T21:32:31Z
Which part is it that takes time for you if you measure?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
edfscott
2016-02-29T21:47:10Z
The piece that takes time is after it leaves main. The visible code goes through quickly. If I "Break All" while I am waiting for it to close Visual Studio tries to go to a piece of code in "ClientWorkTread.vb". If I had to guess, I would guess there is a thread waiting only on a timeout, not using a cancellation token.
Scroll to Top