OK - So I figured out a solution, but I have to determine the impact. The worker thread IsBackground property had been set to false, mainly to increase performance. (This is supposed to be part of a high-performance, low impact auditing framework we are writing) I'm going to make the assumption that the Trace framework, waits for all non-background threads to complete before calling close. Thanks for the help...
Ryan Cromwell
Posts
-
TraceListener.Close not called when added through config file... -
TraceListener.Close not called when added through config file...yup - can't override the TraceListener.Dispose method. You have to override the Dispose( bool ) method which i've done and had no luck with. Stupid Dispose!
-
TraceListener.Close not called when added through config file...True, i haven't implementing the raw Dispose() yet. I'll give it a try, but i'm not holding out hope. :) Dispose( bool ) is the de-facto method for classes that have finalizers and is implemented by a number of classes, including the TraceListener base class.
-
TraceListener.Close not called when added through config file...Hmm - turns out a i forgot a vital piece of infornmation. The hosting application hangs when this problem occurs. I implement the Dispose( bool ) method for just this issue, but it never gets to a point where that would be feasible. It appears, at first glance, that the framework is looking for all the threads owned by the hosting app to finish as its trigger for releasing the dynamic config listeners. It becomes a catch-22, it won't call Close until all threads complete, but I can't know to complete my thread without Close being called. :P Ugh - I really don't want to require explicit addition and closure of this tracelistener, even though it would be understandable concidering the purpose and goal of this specific listener implementation.
-
TraceListener.Close not called when added through config file...I have written a trace listener that has at least one worker thread to process an internal buffer. When the Close method is called explicitly from within the hosting application, everthing is fine and dandy, but if i add the TraceListener from the system.diagnostics section of the config file, the Close method doesn't ever get called. Does anyone have any idea when that method gets called when added through the config file?
-
Sleep PollTell me about it. I hit my bed around 11 every night and wake up between 6:30 and 7:00, but I'm always tired by 2pm. I think i need to stop being such a productive employee
-
Async model questionThe problem arises when the client wants to stop listening. They've decided they no longer want to be a part of the chat session or the video stream or in my case the Trace/Debug broadcast. There very well may be more data "in a while", but the client/subscriber has chosen not to receive that data. I've implemented the Listener loop such that it handles ThreadAbort and does the socket.Shutdown and socket.Close in the finally of try...catch, but it doesn't seem right. I feel as if there should be an interrupt in there somewhere in the ReceiveFrom call on the socket. That's about the only other way to do it, but that's not built into the socket class, so oh well. Anyways, here's what we've got instead...
-
Async model questionWhat is the suggested thread model for a Listener class? My particular situation involves an asyncronous multicast client that continuously listens for available data and notifies via delegates of received data. The problem is the receive function becomes a blocker if the sender no longer publishes data and the ListenHelper function will never progress. I realize that I could Abort the thread, but for some reason that seems like poor solution. Maybe not. See the snippet below: class AsyncMCListener { BeginListen { _thListener = new Thread( new ThreadStart( ListenHelper ) ); _thListener.IsBackground = true; _thListener.Priority = ThreadPriority.BelowNormal; _thListener.Start(); } ListenHelper { while( !_bDone ) { ReceiveData //BLOCKING CALL NotifyConsumerDataReady } } EndListen { _bDone = true; } }
-
setting UserControl properties that are Controls themselvesHow can you, if at all, set properties of a UserControl which happen to be controls themselves (ie System.Web.UI.WebControls.Image) in the designer instead of in the code-behind. Also, how can you use elements instead of attributes to set the properties of a UserControl. Example: This is the Blahest control ever
-
Job hunting...So I've decided I'm no longer am excited about my job. I know I shouldn't care in the context of the job market, but I'm selfish and arrogant. Where is everyone looking/posting jobs at right now. I work for a larger company through consulting firm, but I would like to look on my own as well.
-
TabControl still not goodWhile MS seems to walk both sides of the fence sometimes, they aren't their to do the development for everyone. That's why they built VS in the first place - so people could develop stuff. Most of the controls MS provides are pretty low in functionality anyways - the TabControl is pretty nice for a freebie. And as you said - it's not a tough fix - so go do some development.
-
Internet hosted EXE doesn't like app config fileI have a WinForm app that is fine and dandy when executed as a simply local exe. I'd like to host it via a webserver (http://blahwebserver/MyApp/Myapp.exe). I've gotten through a few initial issues which brought to light some holes in exception handling, but I'm really running into a problem with the config file apparently not being loaded. I don't really know what to do about this or where to research on it, though I kinda hoped it would have been mentioned in here[^] but it wasn't. So I've got nothing at this point.
-
Singleton/static member question...Can someone explain to me the lifetime of a static member variable? That is, in a singleton, one has a static member variable of the single instance and a static member function which returns a reference to that instance. How is it that, 1) the static member variable is maintained, 2) the static member variable is destroyed (GC in the CLR, but what about unmanaged languages)?
-
I have a problem with streaming XML.c:\YourProjectPathHere\GenerateXmlTreeView.aspx is what you are getting from Server.MapPath("GenerateXmlTreeView.aspx") You want: http://
-
Web Setup Project w/ Multiple VirDir'sWe have a number of Support tools that need to be deployed as 2nd Level VirDir's. I have accomplished most of the deployment withing a single setup project with multiple Web Custom Folders for each tool. Problem is as you add each Web project (each tool has it's own) primary output, files, etc, it assumes the dependencies are in place because the previous project had the same ones. Problem is they aren't at the same level and each app/VirDir doesn't have its dependencies. Has anyone figured anything out without adding each dependency or a single project for multiple tools?
-
Oh My GOD, Mass distraction weapon on BaghdadA lot of that was caused by old Patriot guidance systems. The new PAC3's use GPS rather than error prone and intense terrain maps.
-
beginner question in C#output is not a 2 dimensional array. its a 1-dimen. array which happens to be maintaining another 1-dim array. /***********************************************************/ int[,] output = new int[10]; for(int i=0; i<10; i++) output[i] = func(); --- func returns int[100] /***********************************************************/
-
Here's one for yaHoly crapper! If you put a space between the opening OtherSettings element and the opening EmailSettings element, it works fine. Can anyone think of a real good reason that is a bug? Modified: Sorry make that just before the opening OtherSettings element.
-
Here's one for yaTry the following out. Why is the emailsettings element tree read BEFORE the othersettings element (its parent)! Am I blind? while( settings.Read() ) { string section = settings.Name; switch( section.ToLower() ) { case "pollagentsettings": break; case "profileragentsettings": break; case "othersettings": break; } } /* Use this as your settings.xml document - it is the output from the XmlTextWriter */
-
problem with saving XML to xml fileCause it's static.