Search Results

Search found 190 results on 8 pages for 'backgroundworker'.

Page 4/8 | < Previous Page | 1 2 3 4 5 6 7 8  | Next Page >

  • C# Request not timing out

    - by Joel Kennedy
    I have this code which runs in a BackgroundWorker, and should make a POST request to the server and get a response. It works fine when it is supposed to work, but when I try to induce a 404 error it doesn't catch the error reporting system. loginProcess.DoWork += delegate(object s, DoWorkEventArgs args) { // loginProcess BackgroundWorker try { // Try to login, if error, report loginProcess.ReportProgress(10); String method = "POST"; String postdata = "postdata=test"; String url = "http://localhost/dev/login.php"; loginProcess.ReportProgress(15); WebRequest rqst = HttpWebRequest.Create(url); rqst.Timeout = 5000; ((HttpWebRequest)rqst).KeepAlive = true; loginProcess.ReportProgress(20); //rqst.Timeout = this.Timeout; // only needed, if you use HTTP AUTH //CredentialCache creds = new CredentialCache(); //creds.Add(new Uri(url), "Basic", new NetworkCredential(this.Uname, this.Pwd)); //rqst.Credentials = creds; rqst.Method = method; if (!String.IsNullOrEmpty(postdata)) { //rqst.ContentType = "application/xml"; rqst.ContentType = "application/x-www-form-urlencoded"; loginProcess.ReportProgress(30); byte[] byteData = UTF8Encoding.UTF8.GetBytes(postdata); loginProcess.ReportProgress(40); rqst.ContentLength = byteData.Length; loginProcess.ReportProgress(50); using (Stream postStream = rqst.GetRequestStream()) { loginProcess.ReportProgress(50); postStream.Write(byteData, 0, byteData.Length); loginProcess.ReportProgress(60); postStream.Close(); loginProcess.ReportProgress(70); rqst.GetResponse().Close(); rqst.GetRequestStream().Close(); } } loginProcess.ReportProgress(90); using (var response1 = rqst.GetResponse()) { using (var responseStream1 = response1.GetResponseStream()) { using (var reader1 = new StreamReader(responseStream1)) { //StreamReader rsps = new StreamReader(rqst.GetResponse().GetResponseStream()); string strRsps = reader1.ReadToEnd(); loginProcess.ReportProgress(95); loginVars = strRsps; //rqst. //reader1.Close(); //rsps.Dispose(); } args.Result = "SUCCESS"; } } } catch(WebException err) { // Catch error and put into err variable if(err.Status == WebExceptionStatus.ProtocolError) { // If something is wrong with protocol LoginReporting.ErrorName = Convert.ToString(((HttpWebResponse)err.Response).StatusCode); LoginReporting.ErrorDescription = Convert.ToString(((HttpWebResponse)err.Response).StatusDescription); LoginReporting.ErrorNotes = "Error when logging in, Server returned: " + Convert.ToString(((HttpWebResponse)err.Response).StatusCode); LoginReporting.ErrorLocation = "LoginRequest.ProtocolError"; args.Result = "ERROR"; //MessageBox.Show(Convert.ToString(((HttpWebResponse)err.Response).StatusCode)); //MessageBox.Show(Convert.ToString(((HttpWebResponse)err.Response).StatusDescription)); } else { args.Result = "ERROR"; } } catch(Exception err) { // Catch unhandled error LoginReporting.ErrorName = Convert.ToString(err); LoginReporting.ErrorDescription = Convert.ToString(err.Message); LoginReporting.ErrorNotes = "Error when logging in, Server returned: " + Convert.ToString(err.Message); LoginReporting.ErrorLocation = "LoginRequest.ProtocolError"; args.Result = "ERROR"; } }; I have put a timeout on the request but it just doesn't work! Is this a bug, or am I doing something wrong here? Thanks

    Read the article

  • Updating a progress bar while wpf data binding is taking place (in c#)

    - by evan
    I bind a large dataset to a WPF list box which can take a long time (more than ten seconds). While the the data is being bound I'd like to display a circular progress bar I can't get the progress bar to show while the data binding is occurring, even though I am trying to do the binding in a backgroundworker. I tested it by making the first line of the backgroundworkd's dowork event a Thread.Sleep(5000) and sure enough the progress bar started spinning for that duration only to freeze while when the binding started. Is this because both the databinding and the UI updating have to occur on the same thread? Any ideas on how to work around it? Thanks for your help!!

    Read the article

  • Winforms application hungs when switching to another app

    - by joseluisrod
    Hi, I believe I have a potential threading issue. I have a user control that contains the following code: private void btnVerify_Click(object sender, EventArgs e) { if (!backgroundWorkerVerify.IsBusy) { backgroundWorkerVerify.RunWorkerAsync(); } } private void backgroundWorkerVerify_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) { VerifyAppointments(); } private void backgroundWorkerVerify_RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e) { MessageBox.Show("Information was Verified.", "Verify", MessageBoxButtons.OK, MessageBoxIcon.Information); CloseEvent(); } vanilla code. but the issue I have is that when the application is running and the users tabs to another application when they return to mine the application is hung, they get a blank screen and they have to kill it. This started when I put the threading code. Could I have some rogue threads out there? what is the best way to zero in a threading problem? The issue can't be recreated on my machine...I know I must be missing something on how to dispose of a backgroundworker properly. Any thoughts are appreciated, Thanks, Jose

    Read the article

  • WPF Statusbar Updates - help, I seem to be going round in circles

    - by David Ward
    I seem to be going round in circles. I have a WPF application that has a main ribbon window with a status bar. When you navigate to a "view" a user control is displayed as the content of the main window. The view has a ViewModel which handles retrieving data from the database and the View's datacontext is set to the ViewModel. What I want is to have the lengthy operation (data retrieval) run on a background thread and whilst it is running the status in the main window to report appropriately. When the background task is complete, the status should revert back to "Ready" (much the same as Visual Studio). How should I wire this together so that I can have the data access code separated out in the ViewModel whilst keeping a responsive UI? I have tried using the BackgroundWorker is various places in the code and I still end up with an unresponsive UI.

    Read the article

  • Winforms application hangs when switching to another app

    - by joseluisrod
    Hi, I believe I have a potential threading issue. I have a user control that contains the following code: private void btnVerify_Click(object sender, EventArgs e) { if (!backgroundWorkerVerify.IsBusy) { backgroundWorkerVerify.RunWorkerAsync(); } } private void backgroundWorkerVerify_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) { VerifyAppointments(); } private void backgroundWorkerVerify_RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e) { MessageBox.Show("Information was Verified.", "Verify", MessageBoxButtons.OK, MessageBoxIcon.Information); CloseEvent(); } vanilla code. but the issue I have is that when the application is running and the users tabs to another application when they return to mine the application is hung, they get a blank screen and they have to kill it. This started when I put the threading code. Could I have some rogue threads out there? what is the best way to zero in a threading problem? The issue can't be recreated on my machine...I know I must be missing something on how to dispose of a backgroundworker properly. Any thoughts are appreciated, Thanks, Jose

    Read the article

  • How to "kill" background worker completely?

    - by Ken Hung
    Hi All, I am writing a windows application that runs a sequence of digital IO actions repeatedly. This sequence of actions starts when the user click a "START" button, and it is done by a background worker in backgroundWorker1_DoWork(). However, there are occasions when I get the "This backgroundworker is currently busy......." error message. I am thinking of implementing the following in the code, by using a while loop to "kill" the background worker before starting another sequence of action: if (backgroundWorker1.IsBusy == true) { backgroundWorker1.CancelAsync(); while (backgroundWorker1.IsBusy == true) { backgroundWorker1.CancelAsync(); } backgroundWorker1.Dispose(); } backgroundWorker1.RunWorkerAsync(); I think my main concern is, will the backgroundWorker1 be "killed" eventually? If it will, will it take a long time to complete it? Will this coding get me into an infinite loop?

    Read the article

  • Implementing auto-save in WPF / MVVM / NHibernate

    - by Echiban
    My client likes programs like Microsoft OneNote where changes are saved automatically, and he can choose to discard when he explicitly wants to do so. I will have to implement some undo functionality, but I'll figure that out some other time. With NHibernate, I suppose I can call ISession.Update on every single property / binding change, but I can see real pain with this approach down the road. I am not a fan of timers, but maybe a 5 second timer that starts on property / binding change and at timer end use BackgroundWorker thread to save to db. What do you think?

    Read the article

  • How to block the UI during asynchronous operations in WPF

    - by mcintyre321
    We have a WPF app (actually a VSTO WPF app). On certain controls there are multiple elements which, when clicked, load data from a web service and update the UI. Right now, we carry out these web requests synchronously, blocking the UI thread until the response comes back. This prevents the user clicking around the app while the data is loading, potentially putting it into an invalid state to handle the data when it is returned. Of course the app becomes unresponsive if the request takes a long time. Ideally, we'd like to have the cancel button active during this time, but nothing else. Is there a clever way of doing this, or will we have to switch the requests to execute asynchronously using backgroundworker and write something that disables all the controls apart from the cancel button while a request is in progress?

    Read the article

  • C# Spawn Multiple Threads for work then wait until all finished

    - by pharoc
    just want some advice on "best practice" regarding multi-threading tasks. as an example, we have a C# application that upon startup reads data from various "type" table in our database and stores the information in a collection which we pass around the application. this prevents us from hitting the database each time this information is required. at the moment the application is reading data from 10 tables synchronously. i would really like to have the application read from each table in a different thread all running in parallel. the application would wait for all the threads to complete before continuing with the startup of the application. i have looked into BackGroundWorker but just want some advice on accomplishing the above. Does the method sound logical in order to speed up the startup time of our application How can we best handle all the threads keeping in mind that each thread's work is independent of one another, we just need to wait for all the threads to complete before continuing. i look forward to some answers

    Read the article

  • Read StandardOutput Process from BackgroundWorkerProcess method

    - by Nicola Celiento
    Hi all, I'm working with a BackgroundWorker Process from Windows .NET C# application. From the async method I call many instance of cmd.exe Process (foreach), and read from StandardOutput, but at the 3-times cycle the ReadToEnd() method throw Timeout Exception. Here the code: StreamWriter sw = null; DataTable dt2 = null; StringBuilder result = null; Process p = null; for(DataRow dr in dt1.Rows) { arrLine = new string[4]; //new row result = new StringBuilder(); arrLine[0] = dr["ID"].ToString(); arrLine[1] = dr["ChangeSet"].ToString(); #region Initialize Process CMD p = new Process(); ProcessStartInfo info = new ProcessStartInfo(); info.FileName = "cmd.exe"; info.CreateNoWindow = true; info.RedirectStandardInput = true; info.RedirectStandardOutput = true; info.RedirectStandardError = true; info.UseShellExecute = false; p.StartInfo = info; p.Start(); sw = new StreamWriter(p.StandardInput.BaseStream); #endregion using (sw) { if (sw.BaseStream.CanWrite) { sw.WriteLine("cd " + this.path_WORKDIR); sw.WriteLine("tfpt getcs /changeset:" + arrLine[1]); } } string strError = p.StandardError.ReadToEnd(); // Read shell error output commmand (TIMEOUT) result.Append(p.StandardOutput.ReadToEnd()); // Read shell output commmand sw.Close(); sw.Dispose(); p.Close(); p.Dispose(); } Timeout is on code line: string strError = p.StandardError.ReadToEnd(); Can you help me? Thanks!

    Read the article

  • Updating DataGridView from another Form using BackGroundWorker

    - by FezKazi
    Hi! I Have one Form (LoginForm) which has a Background Worker Monitoring a database for new entries. Then I have another Form (AdminForm) which I need to signal to update its datagrids whenever new data is available. I could poll the database in the AdminForm too, but considering that LoginForm is already doing some polling, which can be costly, I just want to signal AdminForm to update the DataGridViews with the new data. You may ask, why is LoginForm doing the polling when youre showing the stuff in the AdminForm? Well, LoginForm is actually processing the data and sending it over the Serial Port :$ heheh. I want it to be able to process the data without having an administrator logged in all the time.

    Read the article

  • Progress Bar not updating

    - by Bailz
    I have the following piece of code to write data to an XML file. private void WriteResidentData() { int count = 1; status = "Writing XML files"; foreach (Site site in sites) { try { //Create the XML file StreamWriter writer = new StreamWriter(path + "\\sites\\" + site.title + ".xml"); writer.WriteLine("<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>"); writer.WriteLine("<customer_list>"); foreach (Resident res in site.GetCustomers()) { bw.ReportProgress((count / customers) * 100); writer.WriteLine("\t<customer>"); writer.WriteLine("\t\t<customer_reference>" + res.reference + "</customer_reference>"); writer.WriteLine("\t\t<customer_name>" + res.name + "</customer_name>"); writer.WriteLine("\t\t<customer_address>" + res.address + "</customer_address>"); writer.WriteLine("\t\t<payment_method>" + res.method + "</payment_method>"); writer.WriteLine("\t\t<payment_cycle>" + res.cycle + "</payment_cycle>"); writer.WriteLine("\t\t<registered>" + CheckWebStatus(res.reference) + "</registered>"); writer.WriteLine("\t</customer>"); count++; } writer.WriteLine("</customer_list>"); writer.Close(); } catch (Exception ex) { lastException = ex; } } } It's using the same BackgroundWorker that gets the data from the database. My progress bar properly displays the progress whilst it is reading from the database. However, after zeroing the progress bar for the XML writing it simply sits at 0 even though the process is completing correctly. Can anyone suggest why?

    Read the article

  • BackgroundWorker - C#

    - by Lars
    Hi. Iam developing a multithreading application using BackroundWorker. In the Do_Work method I call another method, in that method I add alot of data into a list using a while-statement. My goal is to add all the data that in the list to show in a GridView. How can I do that so every time data adds to the list, the gridview uppdates? Instead of waiting that the while-statement has runned finished. When the while-statment adds a value to the list, the value adds into the gridview? It must be in the ProgressChanged, but I dont know how to do that :S Many thanx in advance. /Lars

    Read the article

  • BackgroundWorker and WebBrowser Control

    - by James Jeffery
    Is it possible/recommended to use background worker threads with the web browser control? I am creating a bot that searches google for keywords, then checks for sites in the first 10 pages to see if a site is ranked. The user can provide a maximum of 20 sites to check, and can use proxies. So ideally I'd like to have 5 threads working at once. Is it possible? I might have heard somewhere that there are problems with WebBrowser control and threads.

    Read the article

  • Backgroundworker haults in between

    - by Dharmendra
    I am starting a process lets say abc.exe in a background worker. In the begining everything works fine but in between the newly created process i.e. abc.exe haults. Although I am starting abc.exe as hidden window but I come to know about its hang as it stopes doing log writing. When I close my UI form then again abc.exe starts working. Can anybody tell me what could be the possible cause for this? I am not able to debug the issue as it can happen at any time, I can not replicate it. Please tell me as it is very urgent for me. If some more info is required then please revert back.

    Read the article

  • ProgressBar isn't updating

    - by Nuru Salihu
    I have a progressbar that that is show progress returned by the backgroundworker do_dowork event like below . if (ftpSourceFilePath.Scheme == Uri.UriSchemeFtp) { FtpWebRequest objRequest = (FtpWebRequest)FtpWebRequest.Create(ftpSourceFilePath); NetworkCredential objCredential = new NetworkCredential(userName, password); objRequest.Credentials = objCredential; objRequest.Method = WebRequestMethods.Ftp.DownloadFile; FtpWebResponse objResponse = (FtpWebResponse)objRequest.GetResponse(); StreamReader objReader = new StreamReader(objResponse.GetResponseStream()); int len = 0; int iProgressPercentage = 0; FileStream objFS = new FileStream((cd+"\\VolareUpdate.rar"), FileMode.Create, FileAccess.Write, FileShare.Read); while ((len = objReader.BaseStream.Read(buffer, 0, buffer.Length)) > 0) { objFS.Write(buffer, 0, len); iRunningByteTotal += len; double dIndex = (double)(iRunningByteTotal); double dTotal = (double)buffer.Length; double dProgressPercentage = (dIndex / dTotal); iProgressPercentage = (int)(dProgressPercentage); if (iProgressPercentage > 100) { iProgressPercentage = 100; } bw.ReportProgress(iProgressPercentage); } } However, my progressbar does not update. While searching , i was told the UI thread is being blocked and then i thought may be passing the progress outside the loop will do the trick. then i change to this if (ftpSourceFilePath.Scheme == Uri.UriSchemeFtp) { FtpWebRequest objRequest = (FtpWebRequest)FtpWebRequest.Create(ftpSourceFilePath); NetworkCredential objCredential = new NetworkCredential(userName, password); objRequest.Credentials = objCredential; objRequest.Method = WebRequestMethods.Ftp.DownloadFile; FtpWebResponse objResponse = (FtpWebResponse)objRequest.GetResponse(); StreamReader objReader = new StreamReader(objResponse.GetResponseStream()); int len = 0; int iProgressPercentage = 0; FileStream objFS = new FileStream((cd+"\\VolareUpdate.rar"), FileMode.Create, FileAccess.Write, FileShare.Read); while ((len = objReader.BaseStream.Read(buffer, 0, buffer.Length)) > 0) { objFS.Write(buffer, 0, len); iRunningByteTotal += len; double dIndex = (double)(iRunningByteTotal); double dTotal = (double)buffer.Length; double dProgressPercentage = (dIndex / dTotal); iProgressPercentage = (int)(dProgressPercentage); if (iProgressPercentage > 100) { iProgressPercentage = 100; } // System.Threading.Thread.Sleep(2000); iProgressPercentage++; // SetText("F", true); } bw.ReportProgress(iProgressPercentage); progressBar.Refresh(); } However still didn't help. When i put break point in my workerprogresschanged event, it show the progressbar.value however does not update. I tried progressbar.update(0, i also tried sleeping the thread for a while in the loop still didn't help. Please any suggestion/help would be appreciated .

    Read the article

  • Trigger Backgroundworker Completed event.

    - by fireBand
    Hello, I am trying to display the progress bar(marque) in a separate form (progressForm) while i do some calculation in background. I know the typical way of doing it is to include the calculation in background worker and show progressForm in main thread. This approach how ever will lead to lot of synch issues in my application hence I am showing the progressForm using progressForm.ShowDialog() inside the background worker process. But I need to trigger the Completed event with in the application to close the form. Is this possible? Thanks in advance.

    Read the article

  • DoWork of BackgroundWorker is called twice when RunWorkerAsync is called once?

    - by Power-Mosfet
    I have create a backgroundworker in an class it works, but if i call and wait until the end run, call it for the second time it will do the same process twice i thinks there is somthing wrong with bw.DoWork += private void button1_Click(object sender, EventArgs e) { nptest.test.start("null", "null"); } namespace nptest { class test { public static void start(string str, string strb) { if (bw.IsBusy != true) { bw.WorkerSupportsCancellation = true; bw.DoWork += (obj, e) => bw_DoWork(str, strb); bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted); bw.RunWorkerAsync(); } } private static BackgroundWorker bw = new BackgroundWorker(); private static void bw_DoWork(string str, string strb) { System.Windows.Forms.MessageBox.Show("initializing BackgroundWorker"); } private static void bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if ((e.Cancelled == true)) { Console.WriteLine("Canceled"); } else if (!(e.Error == null)) { Console.WriteLine("Error: " + e.Error.Message); } bw.Dispose(); } } }

    Read the article

  • Delegate within a delegate in VB.NET.

    - by Topdown
    I am trying to write a VB.NET alternative to a C# anonymous function. I wish to call Threading.SynchronizationContext.Current.Send which expects a delegate of type Threading.SendOrPostCallback to be passed to it. The background is here, but because I wish to both pass in a string to MessageBox.Show and also capture the DialogResult I need to define another delegate within. I am struggling with the VB.NET syntax, both from the traditional delegate style, and lambda functions. My go at the traditional syntax is below, but I have gut feeling it should be much simpler than this: Private Sub CollectMesssageBoxResultFromUserAsDelegate(ByVal messageToShow As String, ByRef wasCanceled As Boolean) wasCanceled = False If Windows.Forms.MessageBox.Show(String.Format("{0}{1}Please press [OK] to ignore this error and continue, or [Cancel] to stop here.", messageToShow), "Continue", Windows.Forms.MessageBoxButtons.OKCancel, Windows.Forms.MessageBoxIcon.Exclamation) = Windows.Forms.DialogResult.Cancel Then wasCanceled = True End If End Sub Private Delegate Sub ShowMessageBox(ByVal messageToShow As String, ByRef canceled As Boolean) Private Sub AskUserWhetherToCancel(ByVal message As String, ByVal args As CancelEventArgs) If args Is Nothing Then args = New System.ComponentModel.CancelEventArgs With {.Cancel = False} Dim wasCancelClicked As Boolean Dim firstDelegate As New ShowMessageBox(AddressOf CollectMesssageBoxResultFromUserAsDelegate) '…. Now what?? 'I can’t declare SendOrPostCallback as below: 'Dim myDelegate As New Threading.SendOrPostCallback(AddressOf firstDelegate) End Sub

    Read the article

  • System architecture: simple approach for setting up background tasks behind a web application -- wil

    - by Tim Molendijk
    I have a Django web application and I have some tasks that should operate (or actually: be initiated) on the background. The application is deployed as follows: apache2-mpm-worker; mod_wsgi in daemon mode (1 process, 15 threads). The background tasks have the following characteristics: they need to operate in a regular interval (every 5 minutes or so); they require the application context (i.e. the application packages need to be available in memory); they do not need any input other than database access, in order to perform some not-so-heavy tasks such as sending out e-mail and updating the state of the database. Now I was thinking that the most simple approach to this problem would be simply to piggyback on the existing application process (as spawned by mod_wsgi). By implementing the task as part of the application and providing an HTTP interface for it, I would prevent the overhead of another process that is holding all of the application into memory. A simple cronjob can be setup that sends a request to this HTTP interface every 5 minutes and that would be it. Since the application process provides 15 threads and the tasks are quite lightweight and only running every 5 minutes, I figure they would not be hindering the performance of the web application's user-facing operations. Yet... I have done some online research and I have seen nobody advocating this approach. Many articles suggest a significantly more complex approach based on a full-blown messaging component (such as Celery, which uses RabbitMQ). Although that's sexy, it sounds like overkill to me. Some articles suggest setting up a cronjob that executes a script which performs the tasks. But that doesn't feel very attractive either, as it results in creating a new process that loads the entire application into memory, performs some tiny task, and destroys the process again. And this is repeated every 5 minutes. Does not sound like an elegant solution. So, I'm looking for some feedback on my suggested approach as described in the paragraph before the preceeding paragraph. Is my reasoning correct? Am I overlooking (potential) problems? What about my assumption that application's performance will not be impeded?

    Read the article

  • WPF How to stop animation from a thread in background worker

    - by toni
    Hi! I have a task that takes a long time. I do it with a background worker thread and before start it, since Do_Work I begin an animation over a label and when task finishes, I stop it in RunWorkerCompleted but I received an error because I try to begin/stop animation in the background thread that is not the owner. How can I do this, I mean to begin/stop animation in the background worker? thanks!

    Read the article

  • background-fu pluggin unable to run ./script/generate background

    - by Viola
    I'm following this rdoc: http://rdoc.info/projects/ncr/background-fu and can't run ./script/generate background after installing background-fu as a Rails plugin: ./script/plugin install git://github.com/ncr/background-fu.git I'm getting following error: Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- job (MissingSourceFile) Am I missing something?

    Read the article

  • WPF Best point to udpate a progress bar from backgorundworker

    - by toni
    Hi! I have a task that takes a long time executing. In order to inform about the progress to the user I have a progress bar that I update inside DoWork but I would like anybody tells me if it is the best way to update the progress bar. I have heard that there is a reportprogress event handler but I am confused because I don't know what is the utility of the ReportProgress. Thanks.

    Read the article

  • Run web.py as daemon.

    - by mamcx
    I have a simple web.py program to load data. In the server I don't want to install apache or any webserver. I try to put it as a background service with http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/ And subclassing: (from http://www.jejik.com/files/examples/daemon.py) class Daemon: def start(self): """ Start the daemon """ ... PID CHECKS.... # Start the daemon self.daemonize() self.run() #My code class WebService(Daemon): def run(self): app.run() if __name__ == "__main__": if DEBUG: app.run() else: service = WebService(os.path.join(DIR_ACTUAL,'ElAdministrador.pid')) if len(sys.argv) == 2: if 'start' == sys.argv[1]: service.start() elif 'stop' == sys.argv[1]: service.stop() elif 'restart' == sys.argv[1]: service.restart() else: print "Unknown command" sys.exit(2) sys.exit(0) else: print "usage: %s start|stop|restart" % sys.argv[0] sys.exit(2) However, the web.py software not load (ie: The service no listen) If I call it directly (ie: No using the daemon code) work fine.

    Read the article

  • Using WCF to expose underlying process

    - by Steven
    I think I must be a little dull because I'm having so much difficulty with this. I use WCF for pretty much everything in-house, it's the most appropriate technology. I have a new Silverlight 3 app that is connecting to the WCF service and that's working fine. Where the problem begins is: Because of the expense in creating the objects within this service and the high correlation of individual objects being shared between clients I want to have a console application that basically gathers/calculates/caches all the data for the service 24/7 and the service basically connects to the console app (or whatever it is) and gets the pre-processed data. eg, think of it in terms of a stock reporting app (which it is). Person A has a portfolio of x, y z Person B has a portfolio of x, q, z, r The service needs to provide updated metrics on how their portfolio is performing. So instead of every 1 second processing person A, then person B, the app independently gathers the stock price and persons position information into memory and the service just queries the in memory result. Thanks for your help, I really am feeling dumb right now.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8  | Next Page >