[성현모] CPXV2 Init

This commit is contained in:
SHM
2024-06-26 10:30:00 +09:00
parent cdf12248c5
commit 5958993b6a
588 changed files with 698420 additions and 0 deletions

View File

@ -0,0 +1,216 @@
using System;
using System.CodeDom;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.Remoting.Messaging;
using System.Text;
using System.Threading.Tasks;
using SystemX.Common.Archive;
using SystemX.Common.Serialization;
using SystemX.Net.BaseProtocol;
using static SystemX.Net.Platform.Common.Util.LogMessage;
//STATIC 일반적으로 쓸 공용
namespace SystemX.Common
{
public class ResultEventArgs : EventArgs
{
public bool bProcReuslt { get; set; }
public ResultEventArgs(bool bGetResult)
{
bProcReuslt = bGetResult;
}
~ResultEventArgs()
{
}
}
public class ScheduleEvent : EventArgs
{
public int CALL_NUMBER { get; set; }
public bool PROCESS_RESULT { get; set; }
public string STATE_MSG { get; set; }
public byte nLABEL { get; set; }
public ScheduleEvent(int iCallNumer, bool bState, string strMsg, byte nLabel)
{
CALL_NUMBER = iCallNumer;
PROCESS_RESULT = bState;
STATE_MSG = strMsg;
nLABEL = nLabel;
}
~ScheduleEvent()
{
}
}
public delegate void SendRecvCallEvent(byte[] sender, ScheduleEvent e);
public delegate void SocketCallEvent(object sender, ScheduleEvent e);
//SystemXNetCommons
public static partial class XCommons
{
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
static extern int memcmp(byte[] b1, byte[] b2, long count);
public static bool ByteArrayCompare(byte[] ucArr1, byte[] ucArr2)
{
if (ucArr1 == null || ucArr2 == null)
return false;
if (ucArr1.Length != ucArr2.Length)
return false;
// Validate buffers are the same length.
// This also ensures that the count does not exceed the length of either buffer.
return (memcmp(ucArr1, ucArr2, ucArr1.Length) == 0);
}
public const int PAD_SIZE = 12;
private const int HEAD_SIZE = 8;
private const int TAIL_SIZE = 4;
public static bool isHasRow(DataSet ds)
{
return (ds != null) ? ds.Tables.Cast<DataTable>().Any(table => table.Rows.Count != 0) : false;
}
public static bool isHasRow(DataTable dt)
{
return (dt != null) ? dt.Rows.Count > 0 : false;
}
//
// 요약:
// 패킷 압축 및 마샬링 패킷 마샬링 및 압축 해제시
public class CommonPacketMarshalException : Exception
{
public CommonPacketMarshalException()
{
}
public CommonPacketMarshalException(string message)
: base(message)
{
}
public CommonPacketMarshalException(string message, Exception inner)
: base(message, inner)
{
}
}
public static BASE_PROTOCOL GetHeaderProtocol(int iSize, byte[] CompressMarshalByteStream)
{
byte[] ucDecompressGetByte = new byte[1];
byte[] getRowByte = new byte[iSize - PAD_SIZE];
BASE_PROTOCOL SET_PROTOCOL = new BASE_PROTOCOL();
try
{
try
{
Array.Copy(CompressMarshalByteStream, HEAD_SIZE, getRowByte, 0, iSize - PAD_SIZE);
HEADER_PACKET GetHeaderPacket = new HEADER_PACKET();
int iHeaderSize = Marshal.SizeOf(GetHeaderPacket);
byte[] ucHeaderMake = new byte[iHeaderSize];
GetHeaderPacket = (HEADER_PACKET)SystemXNetSerialization.RawDeSerialize(ucHeaderMake, GetHeaderPacket.GetType());
int iHeadLeng = Marshal.SizeOf(GetHeaderPacket);
byte[] ucHeadBytes = new byte[iHeadLeng];
Array.Copy(getRowByte, 0, ucHeadBytes, 0, iHeadLeng);
GetHeaderPacket = (HEADER_PACKET)SystemXNetSerialization.RawDeSerialize(ucHeadBytes, GetHeaderPacket.GetType());
SET_PROTOCOL = (new BASE_PROTOCOL(GetHeaderPacket.usCommand, GetHeaderPacket.usSubCommand, GetHeaderPacket.uiOptionCommand));
}
catch (Exception e)
{
//throw new CommonPacketMarshalException("General packet marshalling failed.[SystemX.Common : SystemXNetCommons.GetHeaderProtocol]");
MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>>") + @"General packet marshalling failed.[SystemX.Common : SystemXNetCommons.GetHeaderProtocol]\r\n" + e.Message, ConsoleColor.Yellow, LogMessageLevel.DEBUG);
}
}
finally
{
;//Until unused
}
return SET_PROTOCOL;
}
public static HEADER_PACKET GetHeaderPacket(int iSize, byte[] CompressMarshalByteStream)
{
byte[] ucDecompressGetByte = new byte[1];
byte[] getRowByte = new byte[iSize - PAD_SIZE];
HEADER_PACKET GetHeaderPacket = new HEADER_PACKET();
try
{
try
{
Array.Copy(CompressMarshalByteStream, HEAD_SIZE, getRowByte, 0, iSize - PAD_SIZE);
GetHeaderPacket = new HEADER_PACKET();
int iHeaderSize = Marshal.SizeOf(GetHeaderPacket);
byte[] ucHeaderMake = new byte[iHeaderSize];
GetHeaderPacket = (HEADER_PACKET)SystemXNetSerialization.RawDeSerialize(ucHeaderMake, GetHeaderPacket.GetType());
int iHeadLeng = Marshal.SizeOf(GetHeaderPacket);
byte[] ucHeadBytes = new byte[iHeadLeng];
Array.Copy(getRowByte, 0, ucHeadBytes, 0, iHeadLeng);
GetHeaderPacket = (HEADER_PACKET)SystemXNetSerialization.RawDeSerialize(ucHeadBytes, GetHeaderPacket.GetType());
}
catch (Exception e)
{
//throw new CommonPacketMarshalException("General packet marshalling failed.[SystemX.Common : SystemXNetCommons.GetHeaderPacket]");
MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>>") + @"General packet marshalling failed.[SystemX.Common : SystemXNetCommons.GetHeaderPacket]\r\n" + e.Message, ConsoleColor.Yellow, LogMessageLevel.DEBUG);
}
}
finally
{
;//Until unused
}
return GetHeaderPacket;
}
private static byte[] HeadTailMake(uint uiPacketSize, byte[] HeadBuff, byte[] BodyBuff)
{
byte[] ucSetStreamBytes = new byte[uiPacketSize + PAD_SIZE];
ucSetStreamBytes[0] = 0x0D;
ucSetStreamBytes[1] = 0x02;
ucSetStreamBytes[2] = (byte)(uiPacketSize >> 24);
ucSetStreamBytes[3] = (byte)(uiPacketSize >> 16);
ucSetStreamBytes[4] = (byte)(uiPacketSize >> 8);
ucSetStreamBytes[5] = (byte)(uiPacketSize >> 0);
ucSetStreamBytes[6] = 0x08;
ucSetStreamBytes[7] = 0x0A;
Array.Copy(HeadBuff, 0, ucSetStreamBytes, 8, HeadBuff.Count());
Array.Copy(BodyBuff, 0, ucSetStreamBytes, HeadBuff.Count() + HEAD_SIZE, BodyBuff.Count());
ucSetStreamBytes[ucSetStreamBytes.Length - 4] = 0x0D;
ucSetStreamBytes[ucSetStreamBytes.Length - 3] = 0x02;
ucSetStreamBytes[ucSetStreamBytes.Length - 2] = 0x08;
ucSetStreamBytes[ucSetStreamBytes.Length - 1] = 0x0A;
return ucSetStreamBytes;
}
}
}

View File

@ -0,0 +1,271 @@
using System;
using System.CodeDom;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.Remoting.Messaging;
using System.Text;
using System.Threading.Tasks;
using SystemX.Common.Archive;
using SystemX.Common.Serialization;
using SystemX.Net.BaseProtocol;
using static SystemX.Net.Platform.Common.Util.LogMessage;
namespace SystemX.Common
{
public static partial class XCommons
{
public static T ByteStreamToSpecialObject<T>(BASE_PROTOCOL.PROTOCOL_CODE GET_CODE, int iSize, byte[] MarshalByteStream)
{
byte[] getDataByte = new byte[1];
byte[] getRawByte = new byte[iSize - PAD_SIZE];
int iRawDataSize;
object getObj = null;
try
{
try
{
Array.Copy(MarshalByteStream, HEAD_SIZE, getRawByte, 0, iSize - PAD_SIZE);
HEADER_PACKET GetHeaderPacket = new HEADER_PACKET();
int iHeadLeng = Marshal.SizeOf(GetHeaderPacket);
byte[] ucHeadBytes = new byte[iHeadLeng];
Array.Copy(getRawByte, 0, ucHeadBytes, 0, iHeadLeng);
iRawDataSize = getRawByte.Count();
GetHeaderPacket = (HEADER_PACKET)SystemXNetSerialization.RawDeSerialize(ucHeadBytes, GetHeaderPacket.GetType());
getDataByte = new byte[GetHeaderPacket.uiDataLength];
object getPacket = SystemXNetSerialization.SelectPacket(GetHeaderPacket.uiDataLength);
if (getPacket == null) throw new Exception("SystemXNetSerialization.SelectPacket Failed.");
int iBodySize = Marshal.SizeOf(getPacket);
byte[] ucBodyArray = new byte[iBodySize];
Array.Copy(getRawByte, iHeadLeng, ucBodyArray, 0, iBodySize); // iRawDataSize - iHeadLeng);
getPacket = Convert.ChangeType(SystemXNetSerialization.RawDeSerialize(ucBodyArray, getPacket.GetType()), getPacket.GetType());
getPacket = SystemXNetSerialization.RawDeSerialize(ucBodyArray, getPacket.GetType());
Array.Copy((byte[])getPacket.GetType().GetMethod("Data").Invoke(getPacket, null), getDataByte, GetHeaderPacket.uiDataLength);
byte[] ucSpecialObjArray = XDataArchive.DecompressDeflateByteToByte(getDataByte);
if (GET_CODE == BASE_PROTOCOL.PROTOCOL_CODE.CONNECT_STATE)
{
PING_PACKET PingPacket = new PING_PACKET();
PingPacket = (PING_PACKET)Convert.ChangeType(SystemXNetSerialization.RawDeSerialize(ucSpecialObjArray, PingPacket.GetType()), PingPacket.GetType());
PingPacket = (PING_PACKET)SystemXNetSerialization.RawDeSerialize(ucSpecialObjArray, PingPacket.GetType());
getObj = PingPacket;
}
else if (GET_CODE == BASE_PROTOCOL.PROTOCOL_CODE.MIDDLEWARE_MESSAGE)
{
MESSAGE_PACKET MessagePacket = new MESSAGE_PACKET();
MessagePacket = (MESSAGE_PACKET)Convert.ChangeType(SystemXNetSerialization.RawDeSerialize(ucSpecialObjArray, MessagePacket.GetType()), MessagePacket.GetType());
MessagePacket = (MESSAGE_PACKET)SystemXNetSerialization.RawDeSerialize(ucSpecialObjArray, MessagePacket.GetType());
getObj = MessagePacket;
}
else if (GET_CODE == BASE_PROTOCOL.PROTOCOL_CODE.HOST_INFO_CHECK)
{
SYSTEM_HOST_PACKET HostInfoPacket = new SYSTEM_HOST_PACKET();
HostInfoPacket = (SYSTEM_HOST_PACKET)Convert.ChangeType(SystemXNetSerialization.RawDeSerialize(ucSpecialObjArray, HostInfoPacket.GetType()), HostInfoPacket.GetType());
HostInfoPacket = (SYSTEM_HOST_PACKET)SystemXNetSerialization.RawDeSerialize(ucSpecialObjArray, HostInfoPacket.GetType());
getObj = HostInfoPacket;
}
else if (GET_CODE == BASE_PROTOCOL.PROTOCOL_CODE.SYNC_TIME_SERVER)
{
TIME_PACKET timePacket = new TIME_PACKET();
timePacket = (TIME_PACKET)Convert.ChangeType(SystemXNetSerialization.RawDeSerialize(ucSpecialObjArray, timePacket.GetType()), timePacket.GetType());
timePacket = (TIME_PACKET)SystemXNetSerialization.RawDeSerialize(ucSpecialObjArray, timePacket.GetType());
getObj = timePacket;
}
else if (GET_CODE == BASE_PROTOCOL.PROTOCOL_CODE.ETC)
{
USER_PACKET UserDataPacket = new USER_PACKET();
UserDataPacket = (USER_PACKET)Convert.ChangeType(SystemXNetSerialization.RawDeSerialize(ucSpecialObjArray, UserDataPacket.GetType()), UserDataPacket.GetType());
UserDataPacket = (USER_PACKET)SystemXNetSerialization.RawDeSerialize(ucSpecialObjArray, UserDataPacket.GetType());
getObj = UserDataPacket;
}
else if (GET_CODE == BASE_PROTOCOL.PROTOCOL_CODE.PROCESS_QUERY)
{
PROCESS_PACKET ProcessDataPacket = new PROCESS_PACKET();
ProcessDataPacket = (PROCESS_PACKET)Convert.ChangeType(SystemXNetSerialization.RawDeSerialize(ucSpecialObjArray, ProcessDataPacket.GetType()), ProcessDataPacket.GetType());
ProcessDataPacket = (PROCESS_PACKET)SystemXNetSerialization.RawDeSerialize(ucSpecialObjArray, ProcessDataPacket.GetType());
getObj = ProcessDataPacket;
}
else if (GET_CODE == BASE_PROTOCOL.PROTOCOL_CODE.SYSTEM_QUERY)
{
QUERY_PACKET SystemQueryPacket = new QUERY_PACKET();
SystemQueryPacket = (QUERY_PACKET)Convert.ChangeType(SystemXNetSerialization.RawDeSerialize(ucSpecialObjArray, SystemQueryPacket.GetType()), SystemQueryPacket.GetType());
SystemQueryPacket = (QUERY_PACKET)SystemXNetSerialization.RawDeSerialize(ucSpecialObjArray, SystemQueryPacket.GetType());
getObj = SystemQueryPacket;
}
else if (GET_CODE == BASE_PROTOCOL.PROTOCOL_CODE.USER_QUERY)
{
QUERY_PACKET SystemQueryPacket = new QUERY_PACKET();
SystemQueryPacket = (QUERY_PACKET)Convert.ChangeType(SystemXNetSerialization.RawDeSerialize(ucSpecialObjArray, SystemQueryPacket.GetType()), SystemQueryPacket.GetType());
SystemQueryPacket = (QUERY_PACKET)SystemXNetSerialization.RawDeSerialize(ucSpecialObjArray, SystemQueryPacket.GetType());
getObj = SystemQueryPacket;
}
else if (GET_CODE == BASE_PROTOCOL.PROTOCOL_CODE.TRANSFER_RESULT)
{
TRANSFER_PACKET TransferResult = new TRANSFER_PACKET();
TransferResult = (TRANSFER_PACKET)Convert.ChangeType(SystemXNetSerialization.RawDeSerialize(ucSpecialObjArray, TransferResult.GetType()), TransferResult.GetType());
TransferResult = (TRANSFER_PACKET)SystemXNetSerialization.RawDeSerialize(ucSpecialObjArray, TransferResult.GetType());
getObj = TransferResult;
}
else if (GET_CODE == BASE_PROTOCOL.PROTOCOL_CODE.INITILALIZE_INFO)
{
COMM_INFO_PACKET CommInfoPacket = new COMM_INFO_PACKET();
CommInfoPacket = (COMM_INFO_PACKET)Convert.ChangeType(SystemXNetSerialization.RawDeSerialize(ucSpecialObjArray, CommInfoPacket.GetType()), CommInfoPacket.GetType());
CommInfoPacket = (COMM_INFO_PACKET)SystemXNetSerialization.RawDeSerialize(ucSpecialObjArray, CommInfoPacket.GetType());
getObj = CommInfoPacket;
}
else
getObj = null;
}
catch (Exception e)
{
//throw new CommonPacketMarshalException("General packet marshalling failed.[SystemX.Common : SystemXNetCommons.ByteStreamToUserObject]");
MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>>") + @"General packet marshalling failed.[SystemX.Common : SystemXNetCommons.ByteStreamToUserObject]\r\n" + e.Message, ConsoleColor.Yellow, LogMessageLevel.DEBUG);
}
}
finally
{
;//Until unused
}
return (T)Convert.ChangeType(getObj, typeof(T));
}
public static bool GetSimpleResponsResult(int iSize, byte[] CompressMarshalByteStream)
{
byte[] getDataByte = new byte[1];
byte[] getRawByte = new byte[iSize - PAD_SIZE];
bool bResponsResult = false;
try
{
try
{
Array.Copy(CompressMarshalByteStream, HEAD_SIZE, getRawByte, 0, iSize - PAD_SIZE);
HEADER_PACKET GetHeaderPacket = new HEADER_PACKET();
int iHeaderSize = Marshal.SizeOf(GetHeaderPacket);
byte[] ucHeaderMake = new byte[iHeaderSize];
GetHeaderPacket = (HEADER_PACKET)SystemXNetSerialization.RawDeSerialize(ucHeaderMake, GetHeaderPacket.GetType());
int iHeadLeng = Marshal.SizeOf(GetHeaderPacket);
byte[] ucHeadBytes = new byte[iHeadLeng];
Array.Copy(getRawByte, 0, ucHeadBytes, 0, iHeadLeng);
GetHeaderPacket = (HEADER_PACKET)SystemXNetSerialization.RawDeSerialize(ucHeadBytes, GetHeaderPacket.GetType());
getDataByte = new byte[GetHeaderPacket.uiDataLength];
object getPacket = SystemXNetSerialization.SelectPacket(GetHeaderPacket.uiDataLength);
if (getPacket == null) throw new Exception("SystemXNetSerialization.SelectPacket Failed.");
int iBodySize = Marshal.SizeOf(getPacket);
byte[] ucBodyArray = new byte[iBodySize];
Array.Copy(getRawByte, iHeadLeng, ucBodyArray, 0, iBodySize); // - iHeadLeng);
getPacket = Convert.ChangeType(SystemXNetSerialization.RawDeSerialize(ucBodyArray, getPacket.GetType()), getPacket.GetType());
getPacket = SystemXNetSerialization.RawDeSerialize(ucBodyArray, getPacket.GetType());
Array.Copy((byte[])getPacket.GetType().GetMethod("Data").Invoke(getPacket, null), getDataByte, GetHeaderPacket.uiDataLength);
bResponsResult = GetHeaderPacket.bResponsState;
}
catch (Exception e)
{
//throw new CommonPacketMarshalException("General packet marshalling failed.[SystemX.Common : SystemXNetCommons.ByteStreamToObject]");
MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>>") + @"General packet marshalling failed.[SystemX.Common : SystemXNetCommons.ByteStreamToObject]\r\n" + e.Message, ConsoleColor.Yellow, LogMessageLevel.DEBUG);
}
}
finally
{
;//Until unused
}
return bResponsResult;
}
public static T ByteStreamToObject<T>(BASE_PROTOCOL.PROTOCOL_CODE GET_CODE, int iSize, byte[] CompressMarshalByteStream)
{
byte[] getDataByte = new byte[1];
byte[] getRawByte = new byte[iSize - PAD_SIZE];
object getObj = null;
try
{
try
{
Array.Copy(CompressMarshalByteStream, HEAD_SIZE, getRawByte, 0, iSize - PAD_SIZE);
HEADER_PACKET GetHeaderPacket = new HEADER_PACKET();
int iHeaderSize = Marshal.SizeOf(GetHeaderPacket);
byte[] ucHeaderMake = new byte[iHeaderSize];
GetHeaderPacket = (HEADER_PACKET)SystemXNetSerialization.RawDeSerialize(ucHeaderMake, GetHeaderPacket.GetType());
int iHeadLeng = Marshal.SizeOf(GetHeaderPacket);
byte[] ucHeadBytes = new byte[iHeadLeng];
Array.Copy(getRawByte, 0, ucHeadBytes, 0, iHeadLeng);
GetHeaderPacket = (HEADER_PACKET)SystemXNetSerialization.RawDeSerialize(ucHeadBytes, GetHeaderPacket.GetType());
getDataByte = new byte[GetHeaderPacket.uiDataLength];
object getPacket = SystemXNetSerialization.SelectPacket(GetHeaderPacket.uiDataLength);
if (getPacket == null) throw new Exception("SystemXNetSerialization.SelectPacket Failed.");
int iBodySize = Marshal.SizeOf(getPacket);
byte[] ucBodyArray = new byte[iBodySize];
Array.Copy(getRawByte, iHeadLeng, ucBodyArray, 0, iBodySize); // - iHeadLeng);
getPacket = Convert.ChangeType(SystemXNetSerialization.RawDeSerialize(ucBodyArray, getPacket.GetType()), getPacket.GetType());
getPacket = SystemXNetSerialization.RawDeSerialize(ucBodyArray, getPacket.GetType());
Array.Copy((byte[])getPacket.GetType().GetMethod("Data").Invoke(getPacket, null), getDataByte, GetHeaderPacket.uiDataLength);
if (GET_CODE == BASE_PROTOCOL.PROTOCOL_CODE.FILE_TRANSFER)
getObj = getDataByte; //XDataArchive.DecompressDeflateByteToByte(getDataByte);
else if (GET_CODE == BASE_PROTOCOL.PROTOCOL_CODE.DATASET_TRANSEFER)
getObj = XDataArchive.DecompressByteToDataset(getDataByte);
else if (GET_CODE == BASE_PROTOCOL.PROTOCOL_CODE.RAW_SIZE)
getObj = getDataByte;
}
catch (Exception e)
{
//throw new CommonPacketMarshalException("General packet marshalling failed.[SystemX.Common : COMMON.ByteStreamToObject]");
MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>>") + @"General packet marshalling failed.[SystemX.Common : COMMON.ByteStreamToObject]\r\n" + e.Message, ConsoleColor.Yellow, LogMessageLevel.DEBUG);
}
}
finally
{
;//Until unused
}
return (T)Convert.ChangeType(getObj, typeof(T));
}
}
}

View File

@ -0,0 +1,644 @@
using System;
using System.CodeDom;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.Remoting.Messaging;
using System.Text;
using System.Threading.Tasks;
using SystemX.Common.Archive;
using SystemX.Common.Serialization;
using SystemX.Net.BaseProtocol;
using static SystemX.Net.Platform.Common.Util.LogMessage;
namespace SystemX.Common
{
public static partial class XCommons
{
public static byte[] SpecialObjectToByteStream(BASE_PROTOCOL SET_PROTOCOL, object refObj)
{
byte[] ucGetStreamBytes = new byte[1];
try
{
try
{
int iSize = Marshal.SizeOf(refObj);
byte[] SendBuffer = SystemXNetSerialization.RawSerialize(refObj, Marshal.SizeOf(refObj));
var memoryStream = new MemoryStream(SendBuffer);
byte[] getSendCompressFileByte = new byte[1];
getSendCompressFileByte = XDataArchive.CompressDeflateByteToByte(SendBuffer);
iSize = getSendCompressFileByte.Count();
HEADER_PACKET setHeader = new HEADER_PACKET();
int iHeaderSize = Marshal.SizeOf(setHeader);
byte[] ucHeaderMake = new byte[iHeaderSize];
setHeader = (HEADER_PACKET)SystemXNetSerialization.RawDeSerialize(ucHeaderMake, setHeader.GetType());
iHeaderSize = Marshal.SizeOf(setHeader);
setHeader.usCommand = SET_PROTOCOL.COMMAND;
setHeader.usSubCommand = SET_PROTOCOL.SUB_COMMAND;
setHeader.uiOptionCommand = SET_PROTOCOL.OPTION_COMMAND;
setHeader.uiHeaderLength = (uint)iHeaderSize;
setHeader.uiDataLength = (uint)iSize;
setHeader.objOptionName[0].Data = "-";
setHeader.objOptionExtension[0].Data = "-";
setHeader.uiSourDataNum = 0;
setHeader.uiDestDataNum = 0;
byte[] SendHeadBuffer = SystemXNetSerialization.RawSerialize(setHeader, Marshal.SizeOf(setHeader));
object getPacket = SystemXNetSerialization.SelectPacket(setHeader.uiDataLength);
if (getPacket == null) throw new Exception("SystemXNetSerialization.SelectPacket Failed.");
int iBodySize = Marshal.SizeOf(getPacket);
byte[] ucBodyArray = new byte[iBodySize];
getPacket = Convert.ChangeType(SystemXNetSerialization.RawDeSerialize(ucBodyArray, getPacket.GetType()), getPacket.GetType());
Array.Copy(getSendCompressFileByte, (byte[])getPacket.GetType().GetMethod("Data").Invoke(getPacket, null), getSendCompressFileByte.Count());
setHeader.uiBodyLength = (uint)iBodySize;
setHeader.uiPacketLength = (uint)(iHeaderSize + iBodySize);
byte[] SendBodyBuffer = SystemXNetSerialization.RawSerialize(getPacket, Marshal.SizeOf(getPacket));
ucGetStreamBytes = HeadTailMake(setHeader.uiPacketLength, SendHeadBuffer, SendBodyBuffer);
//string strMessage = Encoding.Unicode.GetString(ucGetFileBytes, 0, ucGetFileBytes.Length) + "\r\n";
}
catch (Exception e)
{
//throw new CommonPacketMarshalException("General packet marshalling failed.[SystemX.Common : SystemXNetCommons.UserObjectToByteStream]");
MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>>") + @"General packet marshalling failed.[SystemX.Common : SystemXNetCommons.UserObjectToByteStream]\r\n" + e.Message, ConsoleColor.Yellow, LogMessageLevel.DEBUG);
}
}
finally
{
;//Until unused
}
return ucGetStreamBytes;
}
public static byte[] SetSimpleResponsPacket(BASE_PROTOCOL SET_PROTOCOL, bool bState)
{
byte[] ucGetStreamBytes = new byte[1];
try
{
try
{
if (SET_PROTOCOL.GET_CURRENT_PROTOCOL == BASE_PROTOCOL.PROTOCOL_CODE.SIMPLE_RESPONSE)
{
;//
}
else if (SET_PROTOCOL.GET_CURRENT_PROTOCOL == BASE_PROTOCOL.PROTOCOL_CODE.RAW_END)
{
;//
}
else
return null;
var bytes = new byte[1];
HEADER_PACKET setHeader = new HEADER_PACKET();
int iHeaderSize = Marshal.SizeOf(setHeader);
byte[] ucHeaderMake = new byte[iHeaderSize];
setHeader = (HEADER_PACKET)SystemXNetSerialization.RawDeSerialize(ucHeaderMake, setHeader.GetType());
iHeaderSize = Marshal.SizeOf(setHeader);
setHeader.usCommand = SET_PROTOCOL.COMMAND;
setHeader.usSubCommand = SET_PROTOCOL.SUB_COMMAND;
setHeader.uiOptionCommand = SET_PROTOCOL.OPTION_COMMAND;
setHeader.bResponsState = bState;
setHeader.usHeader = 1;
setHeader.uiHeaderLength = (uint)iHeaderSize;
setHeader.uiDataLength = 512;
setHeader.objOptionName[0].Data = "-";
setHeader.objOptionExtension[0].Data = "-";
setHeader.uiSourDataNum = 0;
setHeader.uiDestDataNum = 0;
object getPacket = SystemXNetSerialization.SelectPacket(512);
if (getPacket == null) throw new Exception("SystemXNetSerialization.SelectPacket Failed.");
int iBodySize = Marshal.SizeOf(getPacket);
byte[] ucBodyArray = new byte[iBodySize];
getPacket = Convert.ChangeType(SystemXNetSerialization.RawDeSerialize(ucBodyArray, getPacket.GetType()), getPacket.GetType());
setHeader.uiBodyLength = (uint)iBodySize;
setHeader.uiPacketLength = (uint)(iHeaderSize + iBodySize);
byte[] SendHeadBuffer = SystemXNetSerialization.RawSerialize(setHeader, Marshal.SizeOf(setHeader));
byte[] SendBodyBuffer = SystemXNetSerialization.RawSerialize(getPacket, Marshal.SizeOf(getPacket));
ucGetStreamBytes = HeadTailMake(setHeader.uiPacketLength, SendHeadBuffer, SendBodyBuffer);
//string strMessage = Encoding.Unicode.GetString(ucGetFileBytes, 0, ucGetFileBytes.Length) + "\r\n";
}
catch (Exception e)
{
//throw new CommonPacketMarshalException("General packet marshalling failed.[SystemX.Common : SystemXNetCommons.SimpleObjectToByteStream]");
MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>>") + @"General packet marshalling failed.[SystemX.Common : SystemXNetCommons.SimpleObjectToByteStream]\r\n" + e.Message, ConsoleColor.Yellow, LogMessageLevel.DEBUG);
}
}
finally
{
;//Until unused
}
return ucGetStreamBytes;
}
public static byte[] ObjectToByteStream(BASE_PROTOCOL SET_PROTOCOL, object refObj, CP_PACKET? getCPPacket = null,
ushort usPalletIndex = 0, int iRecordsAffected = 1, bool bHasRows = true, int iFieldCount = 1, params string[] strParameters)
{
byte[] ucGetStreamBytes = new byte[1];
try
{
try
{
string refObjGetPos = string.Empty;
string strGetFileName = string.Empty;
string strGetExtension = string.Empty;
MemoryStream ms = null;
//
SqlDataReader sqlReader = null;
DataSet ds = new DataSet();
DataTable dt = new DataTable();
bool bCheckPos = true;
bool bResponsSetState = true;
if (SET_PROTOCOL.GET_CURRENT_PROTOCOL == BASE_PROTOCOL.PROTOCOL_CODE.FILE_TRANSFER)
{
if (refObj is MemoryStream)
{
ms = (MemoryStream)refObj;
if (ms == null)
{
bCheckPos = false;
//throw new Exception("MemoryStream not initialize.. " + refObjGetPos);
MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>>") + @"MemoryStream not initialize." + refObjGetPos + " [SystemX.Common : SystemXNetCommons.ObjectToByteStream]", ConsoleColor.Yellow, LogMessageLevel.DEBUG);
}
}
else
{
refObjGetPos = (string)refObj;
if (File.Exists(@refObjGetPos) == false)
{
bCheckPos = false;
//throw new Exception("The file cannot be found. " + refObjGetPos);
MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>>") + @"The file cannot be found." + refObjGetPos + " [SystemX.Common : SystemXNetCommons.ObjectToByteStream]", ConsoleColor.Yellow, LogMessageLevel.DEBUG);
}
else
{
strGetFileName = Path.GetFileNameWithoutExtension(@refObjGetPos);
strGetExtension = Path.GetExtension(@refObjGetPos);
}
}
}
else if (SET_PROTOCOL.GET_CURRENT_PROTOCOL == BASE_PROTOCOL.PROTOCOL_CODE.DATASET_TRANSEFER)
{
if (refObj is SqlDataReader)
{
sqlReader = (SqlDataReader)refObj;
bResponsSetState = false;
if (sqlReader != null)
{
if (sqlReader.RecordsAffected > 0)
bResponsSetState = true;
else if (sqlReader.HasRows == true)
bResponsSetState = true;
else if (sqlReader.FieldCount > 0)
bResponsSetState = true;
else
bResponsSetState = false;
dt.Load(sqlReader);
ds.Tables.Add(dt);
}
}
else if (refObj is DataTable)
{
dt = (DataTable)refObj;
bResponsSetState = false;
if (dt != null)
{
if (iRecordsAffected > 0)
bResponsSetState = true;
else if (bHasRows == true)
bResponsSetState = true;
else if (iFieldCount > 0)
bResponsSetState = true;
else
bResponsSetState = false;
ds.Tables.Add(dt);
}
}
else if (refObj is DataSet)
{
ds = (DataSet)refObj;
bResponsSetState = false;
if (ds != null)
{
if (iRecordsAffected > 0)
bResponsSetState = true;
else if (bHasRows == true)
bResponsSetState = true;
else if (iFieldCount > 0)
bResponsSetState = true;
else
bResponsSetState = false;
}
}
else
{
;//
}
}
if (bCheckPos)
{
var bytes = new byte[1];
if (SET_PROTOCOL.GET_CURRENT_PROTOCOL == BASE_PROTOCOL.PROTOCOL_CODE.FILE_TRANSFER)
{
if (ms != null)
bytes = ms.ToArray();
else
bytes = File.ReadAllBytes(@refObjGetPos);
}
else if (SET_PROTOCOL.GET_CURRENT_PROTOCOL == BASE_PROTOCOL.PROTOCOL_CODE.DATASET_TRANSEFER)
bytes = XDataArchive.CompressDatasetToByte(ds);
var memoryStream = new MemoryStream(bytes);
byte[] getSendOrgFileByte = memoryStream.ToArray();
byte[] getSendCompressFileByte = new byte[1];
if (SET_PROTOCOL.GET_CURRENT_PROTOCOL == BASE_PROTOCOL.PROTOCOL_CODE.FILE_TRANSFER)
getSendCompressFileByte = XDataArchive.CompressDeflateByteToByte(getSendOrgFileByte);
else if (SET_PROTOCOL.GET_CURRENT_PROTOCOL == BASE_PROTOCOL.PROTOCOL_CODE.DATASET_TRANSEFER)
getSendCompressFileByte = memoryStream.ToArray();
HEADER_PACKET setHeader = new HEADER_PACKET();
int iHeaderSize = Marshal.SizeOf(setHeader);
byte[] ucHeaderMake = new byte[iHeaderSize];
setHeader = (HEADER_PACKET)SystemXNetSerialization.RawDeSerialize(ucHeaderMake, setHeader.GetType());
iHeaderSize = Marshal.SizeOf(setHeader);
//Various Parameter
int nParamPos = 0;
foreach (string strParam in strParameters)
{
switch (nParamPos)
{
case 0: setHeader.objVarParam1[0].Data = strParam; break;
case 1: setHeader.objVarParam2[0].Data = strParam; break;
case 2: setHeader.objVarParam3[0].Data = strParam; break;
}
nParamPos++;
}
setHeader.bResponsState = bResponsSetState;
setHeader.usPalletIndex = usPalletIndex;
setHeader.usCommand = SET_PROTOCOL.COMMAND;
setHeader.usSubCommand = SET_PROTOCOL.SUB_COMMAND;
setHeader.uiOptionCommand = SET_PROTOCOL.OPTION_COMMAND;
setHeader.uiHeaderLength = (uint)iHeaderSize;
setHeader.uiDataLength = (uint)getSendCompressFileByte.Count();
setHeader.objOptionName[0].Data = "-";
setHeader.objOptionExtension[0].Data = "-";
if (getCPPacket == null)
{
setHeader.objCP_Packet[0].objStationName[0].Data = "-";
setHeader.objCP_Packet[0].objProdNo_P[0].Data = "-";
setHeader.objCP_Packet[0].objProdNo_C[0].Data = "-";
setHeader.objCP_Packet[0].objTestType[0].Data = "-";
setHeader.objCP_Packet[0].objTestCode[0].Data = "-";
setHeader.objCP_Packet[0].objVersion[0].Data = "-";
setHeader.objCP_Packet[0].objProdCode[0].Data = "-";
setHeader.objCP_Packet[0].uiTestListNo = 0;
}
else
{
setHeader.objCP_Packet[0].objStationName[0].Data = getCPPacket.Value.objStationName[0].Data;
setHeader.objCP_Packet[0].objProdNo_P[0].Data = getCPPacket.Value.objProdNo_P[0].Data;
setHeader.objCP_Packet[0].objProdNo_C[0].Data = getCPPacket.Value.objProdNo_C[0].Data;
setHeader.objCP_Packet[0].objTestType[0].Data = getCPPacket.Value.objTestType[0].Data;
setHeader.objCP_Packet[0].objTestCode[0].Data = getCPPacket.Value.objTestCode[0].Data;
setHeader.objCP_Packet[0].objVersion[0].Data = getCPPacket.Value.objVersion[0].Data;
setHeader.objCP_Packet[0].objProdCode[0].Data = getCPPacket.Value.objProdCode[0].Data;
setHeader.objCP_Packet[0].uiTestListNo = getCPPacket.Value.uiTestListNo;
}
if (SET_PROTOCOL.GET_CURRENT_PROTOCOL == BASE_PROTOCOL.PROTOCOL_CODE.FILE_TRANSFER)
{
if (strGetFileName != string.Empty)
{
setHeader.objOptionName[0].Data = strGetFileName;
setHeader.objOptionExtension[0].Data = strGetExtension;
}
}
setHeader.uiSourDataNum = 0;
setHeader.uiDestDataNum = 0;
object getPacket = SystemXNetSerialization.SelectPacket(setHeader.uiDataLength);
if (getPacket == null) throw new Exception("SystemXNetSerialization.SelectPacket Failed.");
int iBodySize = Marshal.SizeOf(getPacket);
byte[] ucBodyArray = new byte[iBodySize];
getPacket = Convert.ChangeType(SystemXNetSerialization.RawDeSerialize(ucBodyArray, getPacket.GetType()), getPacket.GetType());
Array.Copy(getSendCompressFileByte, (byte[])getPacket.GetType().GetMethod("Data").Invoke(getPacket, null), getSendCompressFileByte.Count());
setHeader.uiBodyLength = (uint)iBodySize;
setHeader.uiPacketLength = (uint)(iHeaderSize + iBodySize);
byte[] SendHeadBuffer = SystemXNetSerialization.RawSerialize(setHeader, Marshal.SizeOf(setHeader));
byte[] SendBodyBuffer = SystemXNetSerialization.RawSerialize(getPacket, Marshal.SizeOf(getPacket));
ucGetStreamBytes = HeadTailMake(setHeader.uiPacketLength, SendHeadBuffer, SendBodyBuffer);
//string strMessage = Encoding.Unicode.GetString(ucGetFileBytes, 0, ucGetFileBytes.Length) + "\r\n";
}
}
catch (Exception e)
{
//throw new CommonPacketMarshalException("General packet marshalling failed.[SystemX.Common : SystemXNetCommons.ObjectToByteStream]");
MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>>") + @"General packet marshalling failed.[SystemX.Common : SystemXNetCommons.ObjectToByteStream]\r\n" + e.Message, ConsoleColor.Yellow, LogMessageLevel.DEBUG);
}
}
finally
{
;//Until unused
}
return ucGetStreamBytes;
}
public static List<byte[]> ObjectToByteStreamList(BASE_PROTOCOL SET_PROTOCOL, object refObj, CP_PACKET? getCPPacket = null,
ushort usPalletIdx = 0, params string[] strParameters)
{
List<byte[]> listStreamRawData = new List<byte[]>();
byte[] ucGetStreamBytes = new byte[1];
try
{
try
{
string refObjGetPos = string.Empty;
string strGetFileName = string.Empty;
string strGetExtension = string.Empty;
bool bCheckPos = true;
// 1 = File, 2 = DataSet
int iSelectType = 0;
if (refObj is string)
{
refObjGetPos = (string)refObj;
if (File.Exists(@refObjGetPos) == false)
{
bCheckPos = false;
//throw new Exception("The file cannot be found. " + refObjGetPos);
MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>>") + @"The file cannot be found. " + refObjGetPos + " [SystemX.Common : SystemXNetCommons.ObjectToByteStreamList]", ConsoleColor.Yellow, LogMessageLevel.DEBUG);
}
else
{
strGetFileName = Path.GetFileNameWithoutExtension(@refObjGetPos);
strGetExtension = Path.GetExtension(@refObjGetPos);
iSelectType = 1;
}
}
else if (refObj is DataSet)
{
strGetFileName = "";
strGetExtension = "";
iSelectType = 2;
}
else
bCheckPos = false;
if (bCheckPos)
{
var bytes = new byte[1];
switch (iSelectType)
{
case 1:
bytes = File.ReadAllBytes(@refObjGetPos);
break;
case 2:
bytes = XDataArchive.CompressDatasetToByte(refObj as DataSet);
break;
}
/*
try
{
Bitmap xBitmap = new Bitmap(@refObjGetPos);
using (var stream = new MemoryStream())
{
stream.Seek(0, SeekOrigin.Begin);
xBitmap.Save(stream, xBitmap.RawFormat);
bytes = stream.ToArray();
}
//ImageConverter _imageConverter = new ImageConverter();
//bytes = (byte[])_imageConverter.ConvertTo(xBitmap, typeof(byte[]));
}
catch (Exception e)
{
bytes = File.ReadAllBytes(@refObjGetPos);
}
*/
var memoryStream = new MemoryStream(bytes);
//moryStream.Seek(0, SeekOrigin.Begin);
//byte[] getSendOrgFileByte = memoryStream.ToArray();
//byte[] getSendCompressFileByte = new byte[1];
//getSendCompressFileByte = XNetArchive.CompressGZipByteToByte(getSendOrgFileByte);
//getSendCompressFileByte = bytes;
if (iSelectType == 1)
{
byte[] getSendCompressFileByte = XDataArchive.CompressGZipByteToByte(memoryStream.ToArray());
memoryStream = new MemoryStream(getSendCompressFileByte);
}
memoryStream.Seek(0, SeekOrigin.Begin);
/*
if (memoryStream.Length < SystemXNetSerialization.MAX_PACKET_SIZE)
{
//throw new Exception("The file use normal send mode. " + refObjGetPos);
MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>>") + @"The file use normal send mode. " + refObjGetPos + " [SystemX.Common : SystemXNetCommons.ObjectToByteStreamList]", ConsoleColor.Yellow, LogMessageLevel.DEBUG);
}
*/
int iFileSize = (int)memoryStream.Length;
int iRemainSize = (int)memoryStream.Length;
uint uiMakeCnt = (uint)(Math.Ceiling((double)((double)iFileSize / (double)SystemXNetSerialization.MAX_PACKET_SIZE)));
int iSendPos = 0;
for (uint i = 0; i < uiMakeCnt; i++)
{
byte[] ucSendData = null;
if (iRemainSize >= SystemXNetSerialization.MAX_PACKET_SIZE)
{
ucSendData = new byte[SystemXNetSerialization.MAX_PACKET_SIZE];
int iRead = memoryStream.Read(ucSendData, 0, SystemXNetSerialization.MAX_PACKET_SIZE);
//Array.Copy(getSendCompressFileByte, iSendPos, ucSendData, 0, SystemXNetSerialization.MAX_PACKET_SIZE);
iSendPos += SystemXNetSerialization.MAX_PACKET_SIZE;
iRemainSize -= SystemXNetSerialization.MAX_PACKET_SIZE;
}
else
{
ucSendData = new byte[iRemainSize];
int iRead = memoryStream.Read(ucSendData, 0, iRemainSize);
//Array.Copy(getSendCompressFileByte, iSendPos, ucSendData, 0, iRemainSize);
iSendPos += iRemainSize;
iRemainSize -= iRemainSize;
}
HEADER_PACKET setHeader = new HEADER_PACKET();
int iHeaderSize = Marshal.SizeOf(setHeader);
byte[] ucHeaderMake = new byte[iHeaderSize];
setHeader = (HEADER_PACKET)SystemXNetSerialization.RawDeSerialize(ucHeaderMake, setHeader.GetType());
iHeaderSize = Marshal.SizeOf(setHeader);
//Various Parameter
int nParamPos = 0;
foreach (string strParam in strParameters)
{
switch (nParamPos)
{
case 0: setHeader.objVarParam1[0].Data = strParam; break;
case 1: setHeader.objVarParam2[0].Data = strParam; break;
case 2: setHeader.objVarParam3[0].Data = strParam; break;
}
nParamPos++;
}
if (iSelectType == 1)
setHeader.usPalletIndex = usPalletIdx;
else if (iSelectType == 2)
setHeader.usPalletIndex = ushort.MaxValue;
setHeader.usCommand = SET_PROTOCOL.COMMAND;
setHeader.usSubCommand = SET_PROTOCOL.SUB_COMMAND;
setHeader.uiOptionCommand = SET_PROTOCOL.OPTION_COMMAND;
setHeader.uiHeaderLength = (uint)iHeaderSize;
setHeader.uiDataLength = (uint)ucSendData.Count();
if (getCPPacket == null)
{
setHeader.objCP_Packet[0].objStationName[0].Data = "-";
setHeader.objCP_Packet[0].objProdNo_P[0].Data = "-";
setHeader.objCP_Packet[0].objProdNo_C[0].Data = "-";
setHeader.objCP_Packet[0].objTestType[0].Data = "-";
setHeader.objCP_Packet[0].objTestCode[0].Data = "-";
setHeader.objCP_Packet[0].objVersion[0].Data = "-";
setHeader.objCP_Packet[0].objProdCode[0].Data = "-";
setHeader.objCP_Packet[0].uiTestListNo = 0;
}
else
{
setHeader.objCP_Packet[0].objStationName[0].Data = getCPPacket.Value.objStationName[0].Data;
setHeader.objCP_Packet[0].objProdNo_P[0].Data = getCPPacket.Value.objProdNo_P[0].Data;
setHeader.objCP_Packet[0].objProdNo_C[0].Data = getCPPacket.Value.objProdNo_C[0].Data;
setHeader.objCP_Packet[0].objTestType[0].Data = getCPPacket.Value.objTestType[0].Data;
setHeader.objCP_Packet[0].objTestCode[0].Data = getCPPacket.Value.objTestCode[0].Data;
setHeader.objCP_Packet[0].objVersion[0].Data = getCPPacket.Value.objVersion[0].Data;
setHeader.objCP_Packet[0].objProdCode[0].Data = getCPPacket.Value.objProdCode[0].Data;
setHeader.objCP_Packet[0].uiTestListNo = getCPPacket.Value.uiTestListNo;
}
setHeader.objOptionName[0].Data = strGetFileName;
setHeader.objOptionExtension[0].Data = strGetExtension;
setHeader.uiSourDataNum = i + 1;
setHeader.uiDestDataNum = uiMakeCnt;
object getPacket = SystemXNetSerialization.SelectPacket(setHeader.uiDataLength);
if (getPacket == null) throw new Exception("SystemXNetSerialization.SelectPacket Failed.");
int iBodySize = Marshal.SizeOf(getPacket);
byte[] ucBodyArray = new byte[iBodySize];
getPacket = Convert.ChangeType(SystemXNetSerialization.RawDeSerialize(ucBodyArray, getPacket.GetType()), getPacket.GetType());
Array.Copy(ucSendData, (byte[])getPacket.GetType().GetMethod("Data").Invoke(getPacket, null), ucSendData.Count());
setHeader.uiBodyLength = (uint)iBodySize;
setHeader.uiPacketLength = (uint)(iHeaderSize + iBodySize);
byte[] SendHeadBuffer = SystemXNetSerialization.RawSerialize(setHeader, Marshal.SizeOf(setHeader));
byte[] SendBodyBuffer = SystemXNetSerialization.RawSerialize(getPacket, Marshal.SizeOf(getPacket));
ucGetStreamBytes = HeadTailMake(setHeader.uiPacketLength, SendHeadBuffer, SendBodyBuffer);
listStreamRawData.Add(ucGetStreamBytes);
}
//string strMessage = Encoding.Unicode.GetString(ucGetFileBytes, 0, ucGetFileBytes.Length) + "\r\n";
}
}
catch (Exception e)
{
//throw new CommonPacketMarshalException("General packet marshalling failed.[SystemX.Common : COMMON.ObjectToByteStreamList]");
MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>>") + @"General packet marshalling failed.[SystemX.Common : COMMON.ObjectToByteStreamList]\r\n" + e.Message, ConsoleColor.Yellow, LogMessageLevel.DEBUG);
}
}
finally
{
;//Until unused
}
return listStreamRawData;
}
}
}