diff --git a/Asterisk.2013/Asterisk.NET/Manager/ManagerConnection.cs b/Asterisk.2013/Asterisk.NET/Manager/ManagerConnection.cs
index b1df8a6..6360752 100644
--- a/Asterisk.2013/Asterisk.NET/Manager/ManagerConnection.cs
+++ b/Asterisk.2013/Asterisk.NET/Manager/ManagerConnection.cs
@@ -109,7 +109,7 @@ namespace AsterNET.Manager
private string password;
private SocketConnection mrSocket;
- private ThreadClass mrReaderThread;
+ private Thread mrReaderThread;
private ManagerReader mrReader;
private int defaultResponseTimeout = 2000;
@@ -139,7 +139,6 @@ namespace AsterNET.Manager
private event ManagerEventHandler internalEvent;
private bool fireAllEvents = false;
private Thread callerThread;
- private bool traceCallerThread = true;
/// Default Fast Reconnect retry counter.
private int reconnectRetryFast = 5;
@@ -644,17 +643,6 @@ namespace AsterNET.Manager
set { reconnectIntervalMax = value; }
}
- #region TraceCallerThread
- ///
- /// Enable
- ///
- internal bool TraceCallerThread
- {
- get { return traceCallerThread; }
- set { traceCallerThread = value; }
- }
- #endregion
-
#region CallerThread
internal Thread CallerThread
{
@@ -1523,26 +1511,33 @@ namespace AsterNET.Manager
#endif
result = false;
}
- if (result)
- {
- if (this.mrReader == null)
- {
- mrReader = new ManagerReader(this);
- mrReaderThread = new Util.ThreadClass(new ThreadStart(this.mrReader.Run), "ManagerReader-" + DateTime.Now.Second);
- mrReader.Socket = mrSocket;
- startReader = true;
- }
- else
- mrReader.Socket = mrSocket;
- mrReader.Reinitialize();
- }
- else
- mrSocket = null;
+ if (result)
+ {
+ if (mrReader == null)
+ {
+ mrReader = new ManagerReader(this);
+ mrReaderThread = new Thread(mrReader.Run) { IsBackground = true, Name = "ManagerReader-" + DateTime.Now.Second };
+ mrReader.Socket = mrSocket;
+ startReader = true;
+ }
+ else
+ {
+ mrReader.Socket = mrSocket;
+ }
+
+ mrReader.Reinitialize();
+ }
+ else
+ {
+ mrSocket = null;
+ }
}
}
- if (startReader)
- mrReaderThread.Start();
+ if (startReader)
+ {
+ mrReaderThread.Start();
+ }
return IsConnected();
}
diff --git a/Asterisk.2013/Asterisk.NET/Manager/ManagerReader.cs b/Asterisk.2013/Asterisk.NET/Manager/ManagerReader.cs
index 3efdc19..fb46c64 100644
--- a/Asterisk.2013/Asterisk.NET/Manager/ManagerReader.cs
+++ b/Asterisk.2013/Asterisk.NET/Manager/ManagerReader.cs
@@ -244,11 +244,7 @@ namespace AsterNET.Manager
lastPacketTime = DateTime.Now;
}
Thread.Sleep(50);
- if (mrConnector.TraceCallerThread && mrConnector.CallerThread != null && mrConnector.CallerThread.ThreadState == ThreadState.Stopped)
- {
- die = true;
- break;
- }
+
continue;
}
#endregion
diff --git a/Asterisk.2013/ChangeLog.txt b/Asterisk.2013/ChangeLog.txt
index abe0003..6e48ff5 100644
--- a/Asterisk.2013/ChangeLog.txt
+++ b/Asterisk.2013/ChangeLog.txt
@@ -1,3 +1,7 @@
+12.06.2014 (mrmad)
+ Removed TraceCallerThread functionality.
+ Changed ManagerReader worker thread creation logic (no longer uses Util.ThreadClass). Thread defaulted to stop automatically when application. ends.
+
07.04.2014 (skrusty)
Fixed conf events not firing
Fixed missing default constructor from AbstractConfbridgeEvent