[성현모] Svn 업데이트 받기

This commit is contained in:
SHM
2025-07-11 09:21:30 +09:00
parent 6e462ca991
commit f0c63da29d
22 changed files with 364 additions and 847 deletions

View File

@ -5,12 +5,12 @@ using System.Runtime.InteropServices;
// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
// 이러한 특성 값을 변경하세요.
[assembly: AssemblyTitle("SystemX.Net.XAdaptor.PC")]
[assembly: AssemblyDescription("For Middleware connect dll(XAdaptor.PC)")]
[assembly: AssemblyDescription("CPX Adaptor")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("SystemX")]
[assembly: AssemblyProduct("SystemX.Net.XAdaptor.PC")]
[assembly: AssemblyCopyright("SystemX Copyright © 2020")]
[assembly: AssemblyTrademark("SystemX.Net")]
[assembly: AssemblyCopyright("© 2025 SystemX Co., Ltd. All rights reserved.")]
[assembly: AssemblyTrademark("CPX Adaptor")]
[assembly: AssemblyCulture("")]
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에
@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를
// 기본값으로 할 수 있습니다.
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("2025.05.15.0001")]
[assembly: AssemblyFileVersion("2025.05.15.0001")]

View File

@ -186,6 +186,8 @@ namespace SystemX.Net.XAdaptor
LoginKEY = string.Empty;
ServerTestListLoadState = false;
ControlFTP = null;
}
// TODO : FTP ALIS

View File

@ -6,6 +6,7 @@ using System.IO;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using System.Threading;
@ -29,8 +30,12 @@ namespace SystemX.Net.XAdaptor.Manager
public XAdaptorManager(string strConfigFilePos = "")
{
AssemblyName assemblyName = Assembly.GetExecutingAssembly().GetName();
Version assemblyVersion = assemblyName.Version;
MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>>") +
@"Use CP-Server[X] Adaptor Version for [CPXV2][v240829] " +
@"Use CP-Server[X] Adaptor Version for [CPXV2][" + assemblyVersion.ToString() + "] " +
"[SystemX.Net.XAdaptor.Manager : XAdaptorManager]", ConsoleColor.Green, LogMessageLevel.FATAL);
strCreateConfigFilePos = string.Empty;
@ -183,10 +188,17 @@ namespace SystemX.Net.XAdaptor.Manager
return GetAdaptorHandler.StateFTP;
}
private eFTPServiceStatus StartFTP()
private eFTPServiceStatus CheckFTP()
{
GetAdaptorHandler.StateFTP = xAdaptor.StartFTPService();
for (int n = 0; n < 3; n++)
{
GetAdaptorHandler.StateFTP = xAdaptor.StartFTPService();
if (GetAdaptorHandler.StateFTP == eFTPServiceStatus.Connected)
break;
if (GetAdaptorHandler.StateFTP == eFTPServiceStatus.Unused)
break;
}
return GetAdaptorHandler.StateFTP;
}
@ -202,7 +214,7 @@ namespace SystemX.Net.XAdaptor.Manager
}
// TODO : FTP ALIS
StartFTP();
CheckFTP();
xAdaptor.ConnectStartStyleAuto = true;
@ -232,7 +244,7 @@ namespace SystemX.Net.XAdaptor.Manager
}
// TODO : FTP ALIS
StartFTP();
CheckFTP();
xAdaptor.ConnectStartStyleAuto = false;

View File

@ -479,51 +479,6 @@ namespace SystemX.Net.XAdaptor.PC
}
}
}
//
/*
if (START_EVENT_TRIGGER[0])
{
START_EVENT_TRIGGER[0] = false;
//CommandConnectAlarmEvent?.BeginInvoke(null, null, null, null);
//CommandConnectAlarmEvent?.Invoke(null, null);
OnCommandConnectAlarm(null, null);
}
if (START_EVENT_TRIGGER[1])
{
START_EVENT_TRIGGER[1] = false;
//StreamConnectAlarmEvent?.BeginInvoke(null, null, null, null);
//StreamConnectAlarmEvent?.Invoke(null, null);
OnStreamConnectAlarm(null, null);
}
*/
//
/*
//Command Stream Conn Check
if (StateClientSocketConnect == false)
goto ROUTINE_OUT;
if (thisConnInfo.stCommandCheckTime.ElapsedMilliseconds >= 60000)
{
SendCommandConnectState();
thisConnInfo.OnCommandCheckTime();
}
//
if (StateClientStreamSocketConnect == false)
goto ROUTINE_OUT;
if (thisConnInfo.stStreamCheckTime.ElapsedMilliseconds >= 60000)
{
SendStreamConnectState();
thisConnInfo.OnStreamCheckTime();
}
ROUTINE_OUT:
*/
}
}
@ -579,7 +534,9 @@ namespace SystemX.Net.XAdaptor.PC
//
if (StateAdaptorConnect)
{
;//
//if (StateClientAutoConnect)
{
}
}
//
thisConnInfo.OnCommandTime();
@ -603,7 +560,7 @@ namespace SystemX.Net.XAdaptor.PC
if (LoadInfo.FTP_Use)
{
ControlFTP = new CtrlFTP(LoadInfo.FTP_Use,
IPAddress.Parse(LoadInfo.FTP_IPAddress), Convert.ToInt32(LoadInfo.FTP_Port),
IPAddress.Parse(LoadInfo.FTP_IPAddress), Convert.ToInt32(LoadInfo.FTP_Port),
LoadInfo.FTP_Account, LoadInfo.FTP_Password);
if (ControlFTP.FTPConnState)
@ -612,7 +569,12 @@ namespace SystemX.Net.XAdaptor.PC
return eFTPServiceStatus.Disconnected;
}
else
{
if (ControlFTP != null)
ControlFTP.FTPConnState = false;
return eFTPServiceStatus.Unused;
}
}
public DataSet WaitSystemQuery(string strQuery)

View File

@ -314,54 +314,6 @@ namespace SystemX.Net.XAdaptor.PC
AsyncResult result = (AsyncResult)ar;
}
/*
private void WaitTskJoin(WaitParameter wp, PacketFlowControl getPF, byte ucGetLabel, bool bUseDataSet = true, long lTimeOut = COMMAND_TIME_OUT)
{
wp.Init(getPF);
Thread t = new Thread(delegate () {
QueryResult.Initialize();
QueryResult.xData = wp.TskCheckResult(ucGetLabel, lTimeOut);
if (QueryResult.xData != null)
{
QueryResult.bQueryResult = QueryResult.xData.bReplayResult;
if (bUseDataSet)
QueryResult.QueryDataSet = QueryResult.xData.objData as DataSet;
else
{
QueryResult.QueryDataSet = null;
if (QueryResult.xData.objData is TRANSFER_PACKET)
{
TRANSFER_PACKET TransferResult = (TRANSFER_PACKET)QueryResult.xData.objData;
byte ucCheckLabel = QueryResult.xData.nLabel;
QueryResult.bFileRecvResult = TransferResult.bRecvResult;
QueryResult.bFileProcessResult = TransferResult.bProcessResult;
}
else if (QueryResult.xData.objData is COMM_INFO_PACKET)
{
COMM_INFO_PACKET Result = (COMM_INFO_PACKET)QueryResult.xData.objData;
byte ucCheckLabel = QueryResult.xData.nLabel;
}
}
QueryResult.strVarParam1 = QueryResult.xData.HeaderPacket.objVarParam1[0].Data;
QueryResult.strVarParam2 = QueryResult.xData.HeaderPacket.objVarParam2[0].Data;
QueryResult.strVarParam3 = QueryResult.xData.HeaderPacket.objVarParam3[0].Data;
}
else
getPF.STM.ClearLabel(ucGetLabel);
});
t.Start();
t.Join();
}
*/
private void WaitThreadJoin(WaitParameter wp, PacketFlowControl getPF, byte ucGetLabel, bool bUseDataSet = true, long lTimeOut = COMMAND_TIME_OUT)
{
wp.Init(getPF);
@ -532,42 +484,6 @@ namespace SystemX.Net.XAdaptor.PC
fc = getFc;
}
/*
public XData TskCheckResult(byte nCheckLabel, long lTimeOut = COMMAND_TIME_OUT)
{
XData getXData = null;
bool bWaitLabel = false;
if (nCheckLabel < 0 || nCheckLabel >= fc.STM.GetLabelSize())
return getXData;
Stopwatch stWaitTImeWatch = new Stopwatch();
stWaitTImeWatch.Start();
while (true)
{
if (stWaitTImeWatch.ElapsedMilliseconds >= lTimeOut)
break;
if (nSignaled == 1)
{
getXData = fc.STM.CheckLabel(nCheckLabel, ref bWaitLabel);
if (bWaitLabel)
{
tResult = true;
break;
}
}
Thread.Sleep(1);
}
return getXData;
}
*/
public XData ThreadWaitResult(byte nCheckLabel, long lTimeOut = COMMAND_TIME_OUT)
{
XData getXData = null;

View File

@ -831,13 +831,29 @@ QUERY_TESTLIST:
// TODO : FTP ALIS
if (LoadInfo.FTP_Use)
{
if(ControlFTP.FTPConnState)
if (ControlFTP.FTPConnState == false)
{
string strSetSendFTPInfo = strSetBackupInfo;
for (int n = 0; n < 3; n++)
{
StateFTP = StartFTPService();
strSetSendFTPInfo += (";" + LoadInfo.HOST_ID);
strSetSendFTPInfo += (";" + LoadInfo.SECTION);
//^_^
if (StateFTP == Comm.IIS_FTP.eFTPServiceStatus.Connected)
break;
if (StateFTP == Comm.IIS_FTP.eFTPServiceStatus.Unused)
break;
if (ControlFTP.FTPConnState)
break;
}
}
string strSetSendFTPInfo = strSetBackupInfo;
strSetSendFTPInfo += (";" + LoadInfo.HOST_ID);
strSetSendFTPInfo += (";" + LoadInfo.SECTION);
if (ControlFTP.FTPConnState)
{
XAdaptorFileLogWrite(eSetFileLogCategory.FTPFileLog, strYYYY, strMM, strdd, strSetSendFTPInfo, strSetBackupFileName, "LogFileSend[FTP]>Try");
string strSetFilePos = MakeZipIncludeInfoCpLog(strSetSendFTPInfo, strSetBackupFilePos, strSetBackupFileName, ucSetBackupFileData);
@ -848,6 +864,7 @@ QUERY_TESTLIST:
if (File.Exists(strSetFilePos))
File.Delete(strSetFilePos);
//string strGetFileName = Path.GetFileName(strSetFilePos);
//string ss = await ControlFTP.FileDownload(strGetFileName, @"D:\");
@ -857,8 +874,18 @@ QUERY_TESTLIST:
{
XAdaptorFileLogWrite(eSetFileLogCategory.FTPFileLog, strYYYY, strMM, strdd, strSetSendFTPInfo, strSetBackupFileName, "LogFileSend[FTP]>Result>Failed");
XAdaptorFileLogWrite(eSetFileLogCategory.FTPFileLog, strYYYY, strMM, strdd, strSetSendFTPInfo, strSetBackupFileName, "LogFileSend[FTP]>Try By Socket");
//실패시 Socket File 전송
//
}
}
else
{
XAdaptorFileLogWrite(eSetFileLogCategory.FTPFileLog, strYYYY, strMM, strdd, strSetSendFTPInfo, strSetBackupFileName, "LogFileSend[FTP]>Disconnect State. Please Check FTP State!");
//실패시 Socket File 전송
//
}
}
try

View File

@ -98,36 +98,6 @@ namespace SystemX.Net.XAdaptor.PC
return bSetResult;
}
/*
private async void ClientCommandConnect()
{
dbNgCodeFinder = null;
ConnectCommandWaitEvent.Reset();
StateAdaptorConnect &= ClientCommandSet(SOCKET_TYPE.TCP, false);
if (ConnectCommandWaitEvent.WaitOne(CONNECT_TIME_OUT))
SetCommandWatchTask();
else
MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>>") + @"SystemX.Net.XAdaptor.PC Command Connect Error.[SystemX.Net.PCAdaptor : XPCAdaptor.XPCAdaptor]", ConsoleColor.Red, LogMessageLevel.DEBUG);
await Task.Delay(1).ConfigureAwait(false);
}
private async void ClientStreamConnect()
{
ConnectStreamWaitEvent.Reset();
StateAdaptorConnect &= ClientStreamSet(SOCKET_TYPE.TCP, false);
if (ConnectStreamWaitEvent.WaitOne(CONNECT_TIME_OUT))
SetStreamWatchTask();
else
MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>>") + @"SystemX.Net.XAdaptor.PC Stream Connect Error.[SystemX.Net.PCAdaptor : XPCAdaptor.XPCAdaptor]", ConsoleColor.Red, LogMessageLevel.DEBUG);
await Task.Delay(1).ConfigureAwait(false);
}
*/
private void ClearCommandClientInstance()
{
if (FlowCommandControl != null)
@ -214,6 +184,10 @@ namespace SystemX.Net.XAdaptor.PC
Random r = new Random(Guid.NewGuid().GetHashCode());
nPortNumber = GetDistributionPort(r, nPortNumber);
MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>>") +
@"Get Distribution Port Number " + nPortNumber.ToString("D4") + " [SystemX.Net.XAdaptor.PC : ClientCommandSet]\r\n",
ConsoleColor.Yellow, LogMessageLevel.DEBUG);
}
try