c# ls증권 etk_decompress 예제

ls증권의 rest api는 10분 200번 제한이 없어서 좋지만 서버로 하여금 압축하여 보내게 할 수가 없다.

레스트representational state transfer는 월드 와이드 웹에서 오가는 전송이다.

[DllImport(@"C:\ls api\xingAPI.dll")] public static extern int ETK_Decompress(nint pszSrc, nint pszDest, int nSrcLen);

int size = Marshal.SizeOf<g3203OutBlock1>();
nint destination = Marshal.AllocHGlobal(size * 2_000);

LS.ETK_Decompress(Response_.ResponsePacket.Data, destination, Response_.ResponsePacket.DataLength);

for (int i = 0; i < Response_.RecordCount; i++)
{
    g3203OutBlock1 block = Marshal.PtrToStructure<g3203OutBlock1>(destination + size * i);
}

Marshal.FreeHGlobal(destination);