Licenseserver.preferredconnection Not Working As Expected. 追蹤

0
Avatar
Legacy Poster

Given the following code:

using (var btEngine = new Seagull.BarTender.Print.Engine())
{
btEngine.Start();

var btFormat = btEngine.Documents.Open("C:\abc\xyz.btw");


// Set label values here......


btEngine.LicenseServer.PreferredConnection.Timeout = 1;
btEngine.LicenseServer.PreferredConnection.Retries = 0;

var messages = new Seagull.BarTender.Print.Messages();
btFormat.Print("Bartender", out messages);


// Display error messages here......


btFormat.Close(Seagull.BarTender.Print.SaveOptions.DoNotSaveChanges);
}

There is something not working as expected with the "btEngine.LicenseServer.PreferredConnection" instructions. Basically, give the code above, I would expect for Bartender to fail if it takes it over one second to connect to the license server. However, based on my experiments, it takes Bartender way more than one second to fail (maybe like 15 seconds on my particular machine). Not only that, if I was to change the "PreferredConnection.Timeout" to 5 seconds then Bartender will take over 1 minute to fail.

So what am I missing? I need Bartender to fail after 10 seconds if is not able to connection to the License Server. I don't want it to retry or try to use an alternate licence server.

Thank you.

1 意見

0
Avatar
Gene Henson
評論操作 永久連結

Hello,

Unfortunately, there is a little more going on behind the scenes than this dialog would lead you to believe. There are several operations being attempted internally each time BarTender tries to connect to License Server. Each of these operations uses the timeout and retries values given. Therefore the actual time before failure will be some multiple of the values given. The number and type of these operations is not always easy to predict. For example, BarTender will attempt to contact License Server using every network protocol that the host computer supports, one after the other.

Is there a particular reason that you wish BarTender to fail after just 10 seconds? In general, we’ve tried to make the connection between BarTender and Seagull License Server as forgiving as possible. We also have a Grace Period that allows BarTender to continue printing for a period of time even if it loses connection to License Server due to a problem on the network or the computer hosting License Server. For more information on BarTender’s SLS–Connectivity Grace Period, see page 8 of this White Paper: [url="http://docs.seagullscientific.com/whitepapers/WhitePaper_LicensingForBarTendersAutomationEditions_English.pdf"]http://docs.seagullscientific.com/whitepapers/WhitePaper_LicensingForBarTendersAutomationEditions_English.pdf[/url]

If you let us know a little more about why you’re looking for a 10 second failure, we might be able to help you find an acceptable solution.

登入寫評論。