1
Vote

Out of bounds error in Send(FaxInformations informations, PrintDocument document) method of the FaxServer

description

(Win 7-64-bit) At the end of the method the list of jobs is refreshed and the last one submitted by the current user is returned. There is a delay between the call to print the document and the time the job will be returned in this list. If the job list is empty before the job is submitted, refreshing right away will return an empty list. A sleep and a null check will resolve this.
 
            //Get last user job
            System.Threading.Thread.Sleep(500);
            this.RefreshJobs();
            jobs = this.Jobs.GetJobsUser();
 
            if (jobs.Length < 1)
            {
                return null;
            }
            return jobs[jobs.Length - 1];
 
Another thing to note is that if you are using this in a multi-threaded environment another thread may submit a job after this one, causing the wrong job to be returned.

comments

GillesTourreau wrote Apr 15, 2012 at 5:30 PM

Thanks for your feedback lurchss !

I have no way to fix it, because with the Send(PrintDocument) method i have no information about the job id.
Maybe in a next release I will remove the FaxJob returned by the method. Developper need to find themself the FaxJob created.

Thanks again !

wrote Apr 15, 2012 at 5:40 PM

wrote Feb 14, 2013 at 2:19 AM