Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by [EMAIL PROTECTED]

http://bugzilla.ximian.com/show_bug.cgi?id=77203

--- shadow/77203        2006-01-10 19:55:51.000000000 -0500
+++ shadow/77203.tmp.10122      2006-01-10 19:55:51.000000000 -0500
@@ -0,0 +1,96 @@
+Bug#: 77203
+Product: Mono: Runtime
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: misc
+AssignedTo: [EMAIL PROTECTED]                            
+ReportedBy: [EMAIL PROTECTED]               
+QAContact: [EMAIL PROTECTED]
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Process does not return from the Main() function
+
+Description of Problem:
+
+We have a simple Main function in which we are implementing a Command Line 
+Interface which accepts a user command and forwards the command to a DLL. 
+This is a do-while loop and if the user ebter's exit' it breaks from the 
+loop and should return from Main(). The problem is that on 'exit', the 
+program hangs and does not return from Main().
+
+static int Main(string[] args)
+{
+        string strInput = "";
+
+       objTHoT = new THoTLogicLayer();
+       obj = new TH_ProtLib();
+       THoTLogicLayer.strInterfaceType = "CLI";
+
+        // Create a new thread
+       Thread execThread = new Thread(new ThreadStart
+(XmlRpcServer.StartXmlRpcServer));
+       //StartXmlRpcServer
+       // Start the thread.
+       execThread.Start();
+
+       Console.WriteLine();
+
+       try
+       {
+       do
+       {
+               Console.Write("THoT%");
+               strInput = Console.ReadLine();
+                                               
+               if(strInput != null)
+               {
+                       string [] strCommand  = ParseCommand(strInput);
+                               
+                       if(strInput.Trim() == "")
+                               continue;
+                       else if(strCommand[0].ToLower() == "exit")
+                               break;
+
+                       ExecuteCommand(strCommand);
+               }
+               else
+               {
+                       Console.ReadLine();
+                       break;
+               }
+                       
+       } while(true);
+        }
+       catch(Exception ex)
+       {
+               Console.WriteLine("Exception: " + ex.Message);
+               Console.ReadLine();
+       }
+
+       return 0;
+}
+
+Steps to reproduce the problem:
+1. Run the above code segment 
+2. type 'exit' at the command line prompt and hit ENTER
+
+
+Actual Results:
+    
+      Process hangs.
+
+Expected Results:
+
+      Program should exit gracefully.
+
+How often does this happen? 
+   
+      Everytime.
+
+Additional Information:
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to