See changelog 12.06.2014 for ManagerReader worker thread changes.

This commit is contained in:
unknown 2014-06-12 10:08:52 +02:00
parent 15303ed606
commit a76d37a7f1
3 changed files with 30 additions and 35 deletions

View file

@ -109,7 +109,7 @@ namespace AsterNET.Manager
private string password; private string password;
private SocketConnection mrSocket; private SocketConnection mrSocket;
private ThreadClass mrReaderThread; private Thread mrReaderThread;
private ManagerReader mrReader; private ManagerReader mrReader;
private int defaultResponseTimeout = 2000; private int defaultResponseTimeout = 2000;
@ -139,7 +139,6 @@ namespace AsterNET.Manager
private event ManagerEventHandler internalEvent; private event ManagerEventHandler internalEvent;
private bool fireAllEvents = false; private bool fireAllEvents = false;
private Thread callerThread; private Thread callerThread;
private bool traceCallerThread = true;
/// <summary> Default Fast Reconnect retry counter.</summary> /// <summary> Default Fast Reconnect retry counter.</summary>
private int reconnectRetryFast = 5; private int reconnectRetryFast = 5;
@ -644,17 +643,6 @@ namespace AsterNET.Manager
set { reconnectIntervalMax = value; } set { reconnectIntervalMax = value; }
} }
#region TraceCallerThread
/// <summary>
/// Enable
/// </summary>
internal bool TraceCallerThread
{
get { return traceCallerThread; }
set { traceCallerThread = value; }
}
#endregion
#region CallerThread #region CallerThread
internal Thread CallerThread internal Thread CallerThread
{ {
@ -1523,26 +1511,33 @@ namespace AsterNET.Manager
#endif #endif
result = false; result = false;
} }
if (result) if (result)
{ {
if (this.mrReader == null) if (mrReader == null)
{ {
mrReader = new ManagerReader(this); mrReader = new ManagerReader(this);
mrReaderThread = new Util.ThreadClass(new ThreadStart(this.mrReader.Run), "ManagerReader-" + DateTime.Now.Second); mrReaderThread = new Thread(mrReader.Run) { IsBackground = true, Name = "ManagerReader-" + DateTime.Now.Second };
mrReader.Socket = mrSocket; mrReader.Socket = mrSocket;
startReader = true; startReader = true;
} }
else else
mrReader.Socket = mrSocket; {
mrReader.Reinitialize(); mrReader.Socket = mrSocket;
} }
else
mrSocket = null; mrReader.Reinitialize();
}
else
{
mrSocket = null;
}
} }
} }
if (startReader) if (startReader)
mrReaderThread.Start(); {
mrReaderThread.Start();
}
return IsConnected(); return IsConnected();
} }

View file

@ -244,11 +244,7 @@ namespace AsterNET.Manager
lastPacketTime = DateTime.Now; lastPacketTime = DateTime.Now;
} }
Thread.Sleep(50); Thread.Sleep(50);
if (mrConnector.TraceCallerThread && mrConnector.CallerThread != null && mrConnector.CallerThread.ThreadState == ThreadState.Stopped)
{
die = true;
break;
}
continue; continue;
} }
#endregion #endregion

View file

@ -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) 07.04.2014 (skrusty)
Fixed conf events not firing Fixed conf events not firing
Fixed missing default constructor from AbstractConfbridgeEvent Fixed missing default constructor from AbstractConfbridgeEvent