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 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;
/// <summary> Default Fast Reconnect retry counter.</summary>
private int reconnectRetryFast = 5;
@ -644,17 +643,6 @@ namespace AsterNET.Manager
set { reconnectIntervalMax = value; }
}
#region TraceCallerThread
/// <summary>
/// Enable
/// </summary>
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();
}

View file

@ -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

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