[성현모] JsonConvertTool 추가, 서머리 수량 버그수정

This commit is contained in:
SHM
2024-10-25 13:40:03 +09:00
parent 3c8bece6b6
commit b76569d02f
52 changed files with 1148 additions and 547 deletions

View File

@ -84,6 +84,12 @@ namespace SystemX.Net.XAdaptor.PC
private CancellationTokenSource SubCTS;
private CancellationToken SubCT;
//
private Task taskConnectWorkProcess;
private bool m_bTaskConnectWorkBlock;
//
CancellationTokenSource ConnWorkCTS;
CancellationToken ConnWorkCT;
//
private bool bConnectCommandSocketFlag;
private bool bConnectStreamSocketFlag;
//
@ -170,12 +176,12 @@ namespace SystemX.Net.XAdaptor.PC
return null;
}
private enum TIMER_LOCK
private enum TASK_RUN_SYNC_LOCK
{
RECONNECT_TIMER = 0
CONN_WORKER = 0
}
private bool[] m_bTimerLock;
private bool[] TaskRunSyncLock;
private void InitMember()
{
@ -260,10 +266,24 @@ namespace SystemX.Net.XAdaptor.PC
{
RecvWaitEvent -= RecvWaitEventCall;
ClearCommandWatchTask();
ClearStreamWatchTask();
if (taskConnectWorkProcess != null)
{
ConnWorkCTS.Cancel();
m_bTaskConnectWorkBlock = true;
taskConnectWorkProcess.ConfigureAwait(false);
//taskConnectWorkProcess.Wait();
taskConnectWorkProcess = null;
}
if (bDisposing)
{
ClearCommandWatchTask();
ClearStreamWatchTask();
;//
}
ClearCommandClientInstance();
@ -275,16 +295,6 @@ namespace SystemX.Net.XAdaptor.PC
// suppress calling of Finalizer
GC.SuppressFinalize(this);
}
private void SetRetryTimer()
{
reConnectTimer = new WTimer();
reConnectTimer.Enabled = false;
reConnectTimer.Interval = 1500;
reConnectTimer.Tick += ReConnectTimer_Tick;
reConnectTimer.Start();
reConnectTimer.Enabled = true;
}
private bool CheckConfigFileBuildEndPoint()
{
@ -411,13 +421,15 @@ namespace SystemX.Net.XAdaptor.PC
ClearStreamClientInstance();
}
private async void ReConnectTimer_Tick(object sender, EventArgs e)
private async void ConnWorker()
{
if (m_bTimerLock[(int)TIMER_LOCK.RECONNECT_TIMER] == false)
{
m_bTimerLock[(int)TIMER_LOCK.RECONNECT_TIMER] = true;
while(ConnWorkCT.IsCancellationRequested == false &&
m_bTaskConnectWorkBlock == false &&
TaskRunSyncLock[(int)TASK_RUN_SYNC_LOCK.CONN_WORKER] == false)
{
await Task.Delay(250);
if(SubscribeConnectInfo.bSetChangeConnect)
if (SubscribeConnectInfo.bSetChangeConnect)
{
if (SubscribeConnectInfo.bReqConnectAbort == false)
SubscribeConnectInfo.bReqConnectAbort = true;
@ -512,8 +524,6 @@ namespace SystemX.Net.XAdaptor.PC
ROUTINE_OUT:
*/
m_bTimerLock[(int)TIMER_LOCK.RECONNECT_TIMER] = false;
}
}
@ -559,8 +569,8 @@ namespace SystemX.Net.XAdaptor.PC
thisConnInfo = new ClientInfoStore();
//
m_bTimerLock = new bool[10];
Array.Clear(m_bTimerLock, 0, 10);
TaskRunSyncLock = new bool[10];
Array.Clear(TaskRunSyncLock, 0, 10);
//
if (ClientReadyEndPoint == false)
CheckConfigFileBuildEndPoint();
@ -578,8 +588,13 @@ namespace SystemX.Net.XAdaptor.PC
thisConnInfo.OnStreamTime();
thisConnInfo.OnStreamCheckTime();
//
//if (CLIENT_AUTO_CONNECT)
SetRetryTimer();
ConnWorkCTS = new CancellationTokenSource();
ConnWorkCT = ConnWorkCTS.Token;
m_bTaskConnectWorkBlock = false;
taskConnectWorkProcess = new Task(new Action(ConnWorker), ConnWorkCT);
taskConnectWorkProcess.Start();
//
}
// TODO : FTP ALIS