Windows에서 리눅스의 Shared Memory와 유사한 구조는 메모리 맵 파일 (Memory-Mapped File) 입니다.

메모리 맵 파일은 두 프로세스 간의 데이터 공유를 위해 사용할 수 있으며, 파일의 내용을 메모리에 매핑하여 프로세스가 이를 공유하게끔 합니다. 이는 리눅스의 shm_open()와 mmap() 함수로 메모리를 공유하는 방식과 유사합니다. Windows에서는 CreateFileMapping()과 MapViewOfFile() 함수를 사용하여 메모리 맵 파일을 생성하고, 이를 통해 메모리에 데이터를 매핑하여 여러 프로세스 간에 공유할 수 있습니다.

이 방식을 사용하면 각 프로세스가 같은 메모리 영역을 볼 수 있어 효율적으로 데이터를 교환할 수 있으며, 주로 큰 데이터 집합을 공유하거나 IPC(Inter-Process Communication)를 구현할 때 사용됩니다.

struct  KSEJONG_MEMREC     {
Ubyte lock_flag; /* 메모리사용상태 */
Ubyte seq[4];
Ubyte seq_no[4];
Ubyte   full_code[12];
Ubyte   code[7];
Ubyte jmast[SZ_JMAST +1];
Ubyte jsise[SZ_JSISE +1];
Ubyte info[SZ_INFO  +1];
Ubyte hando[SZ_HANDO +1];
Ubyte chegyul_cnt[2];
Ubyte danilsise[SZ_DANILSISE+1];
Ubyte   danilchegyul[CNT_DANILCHEGYUL][SZ_TIMECHEGYUL + 1];
};
#define SZ_KSEJONG_MEMREC  sizeof(struct   KSEJONG_MEMREC)
#define OFF_KSESHM (SZ_KSEJONG_MEMREC * CNT_KSEJONG)

Windows에서 C 언어로 KSEJONG_MEMREC 구조체를 메모리 맵 파일을 통해 공유하는 예제를 구성해보겠습니다. 아래 코드는 KSEJONG_MEMREC 구조체를 정의하고, 메모리 맵 파일을 통해 데이터를 공유하는 예제입니다. 한 프로그램에서 데이터를 쓰고, 다른 프로그램에서 이를 읽을 수 있도록 작성하였습니다.

1. 구조체 정의 및 메모리 맵 파일에 쓰기

먼저, 메모리 맵 파일에 데이터를 쓰는 코드를 작성하겠습니다.

#include <windows.h>
#include <stdio.h>
#include <string.h>

#define SZ_JMAST 20
#define SZ_JSISE 20
#define SZ_INFO 20
#define SZ_HANDO 20
#define SZ_DANILSISE 20
#define CNT_DANILCHEGYUL 5
#define SZ_TIMECHEGYUL 20
#define CNT_KSEJONG 10

// KSEJONG_MEMREC 구조체 정의
#pragma pack(push, 1)
typedef struct {
    BYTE lock_flag;                 // 메모리 사용 상태
    BYTE seq[4];                    // 주소
    BYTE seq_no[4];                 // 신코드Seq
    BYTE full_code[12];             // 풀코드
    BYTE code[7];                   // 단축코드
    BYTE jmast[SZ_JMAST + 1];       // 거래소 종목마스터
    BYTE jsise[SZ_JSISE + 1];       // 거래소 종목시세
    BYTE info[SZ_INFO + 1];         // 거래소 거래원정보
    BYTE hando[SZ_HANDO + 1];       // 거래소 외국인한도
    BYTE chegyul_cnt[2];            // 체결 갯수
    BYTE danilsise[SZ_DANILSISE + 1]; // 시세
    BYTE danilchegyul[CNT_DANILCHEGYUL][SZ_TIMECHEGYUL + 1]; // 체결
} KSEJONG_MEMREC;
#pragma pack(pop)

#define MEM_SIZE (sizeof(KSEJONG_MEMREC) * CNT_KSEJONG)

int main()
{
    // 메모리 맵 파일 생성
    HANDLE hMapFile = CreateFileMapping(
        INVALID_HANDLE_VALUE,
        NULL,
        PAGE_READWRITE,
        0,
        MEM_SIZE,
        TEXT("KSEJONG_SharedMemory"));

    if (hMapFile == NULL) {
        printf("Could not create file mapping object (%d).\n", GetLastError());
        return 1;
    }

    // 메모리 맵 파일에 대한 뷰 생성
    KSEJONG_MEMREC* pBuf = (KSEJONG_MEMREC*) MapViewOfFile(
        hMapFile,
        FILE_MAP_ALL_ACCESS,
        0,
        0,
        MEM_SIZE);

    if (pBuf == NULL) {
        printf("Could not map view of file (%d).\n", GetLastError());
        CloseHandle(hMapFile);
        return 1;
    }

    // 데이터 초기화 및 쓰기
    memset(pBuf, 0, sizeof(KSEJONG_MEMREC));
    pBuf->lock_flag = 1;
    memcpy(pBuf->seq, "1234", 4);
    memcpy(pBuf->seq_no, "5678", 4);
    memcpy(pBuf->full_code, "FULLCODE1234", 12);
    memcpy(pBuf->code, "CODE123", 7);
    memcpy(pBuf->jmast, "MasterInfo", 10);
    memcpy(pBuf->jsise, "PriceInfo", 9);
    memcpy(pBuf->info, "TradeInfo", 9);
    memcpy(pBuf->hando, "HandoInfo", 9);
    pBuf->chegyul_cnt[0] = 1;
    pBuf->chegyul_cnt[1] = 2;
    memcpy(pBuf->danilsise, "PriceData", 9);
    memcpy(pBuf->danilchegyul[0], "TradeData1", 10);

    printf("Data written to shared memory.\n");

    // 메모리 뷰 및 핸들 닫기
    UnmapViewOfFile(pBuf);
    CloseHandle(hMapFile);

    return 0;
}

2. 메모리 맵 파일에서 데이터 읽기

다음은 메모리 맵 파일에 저장된 데이터를 읽는 코드입니다.

#include <windows.h>
#include <stdio.h>

#define SZ_JMAST 20
#define SZ_JSISE 20
#define SZ_INFO 20
#define SZ_HANDO 20
#define SZ_DANILSISE 20
#define CNT_DANILCHEGYUL 5
#define SZ_TIMECHEGYUL 20
#define CNT_KSEJONG 10

#pragma pack(push, 1)
typedef struct {
    BYTE lock_flag;
    BYTE seq[4];
    BYTE seq_no[4];
    BYTE full_code[12];
    BYTE code[7];
    BYTE jmast[SZ_JMAST + 1];
    BYTE jsise[SZ_JSISE + 1];
    BYTE info[SZ_INFO + 1];
    BYTE hando[SZ_HANDO + 1];
    BYTE chegyul_cnt[2];
    BYTE danilsise[SZ_DANILSISE + 1];
    BYTE danilchegyul[CNT_DANILCHEGYUL][SZ_TIMECHEGYUL + 1];
} KSEJONG_MEMREC;
#pragma pack(pop)

#define MEM_SIZE (sizeof(KSEJONG_MEMREC) * CNT_KSEJONG)

int main()
{
    // 기존 메모리 맵 파일 열기
    HANDLE hMapFile = OpenFileMapping(
        FILE_MAP_ALL_ACCESS,
        FALSE,
        TEXT("KSEJONG_SharedMemory"));

    if (hMapFile == NULL) {
        printf("Could not open file mapping object (%d).\n", GetLastError());
        return 1;
    }

    // 메모리 맵 파일에 대한 뷰 생성
    KSEJONG_MEMREC* pBuf = (KSEJONG_MEMREC*) MapViewOfFile(
        hMapFile,
        FILE_MAP_ALL_ACCESS,
        0,
        0,
        MEM_SIZE);

    if (pBuf == NULL) {
        printf("Could not map view of file (%d).\n", GetLastError());
        CloseHandle(hMapFile);
        return 1;
    }

    // 데이터 읽기
    printf("Read from shared memory:\n");
    printf("Lock Flag: %d\n", pBuf->lock_flag);
    printf("Seq: %.4s\n", pBuf->seq);
    printf("Seq No: %.4s\n", pBuf->seq_no);
    printf("Full Code: %.12s\n", pBuf->full_code);
    printf("Code: %.7s\n", pBuf->code);
    printf("Jmast: %.10s\n", pBuf->jmast);
    printf("Jsise: %.9s\n", pBuf->jsise);
    printf("Info: %.9s\n", pBuf->info);
    printf("Hando: %.9s\n", pBuf->hando);
    printf("Chegyul Cnt: %d %d\n", pBuf->chegyul_cnt[0], pBuf->chegyul_cnt[1]);
    printf("Danilsise: %.9s\n", pBuf->danilsise);
    printf("Danilchegyul[0]: %.10s\n", pBuf->danilchegyul[0]);

    // 메모리 뷰 및 핸들 닫기
    UnmapViewOfFile(pBuf);
    CloseHandle(hMapFile);

    return 0;
}

설명

  1. 쓰기 코드는 CreateFileMapping으로 메모리 맵 파일을 생성하고 MapViewOfFile로 메모리 뷰를 얻습니다. 이후 구조체 데이터를 메모리에 씁니다.
  2. 읽기 코드는 OpenFileMapping을 통해 기존 메모리 맵 파일에 접근하고, MapViewOfFile로 메모리 뷰를 얻어 데이터를 읽어옵니다.

이 코드를 통해 Windows 환경에서 C 언어로 Shared Memory를 사용할 수 있습니다.

이 코드는 Windows API 함수(CreateFileMapping, MapViewOfFile, UnmapViewOfFile, CloseHandle 등)를 사용하기 때문에 추가적인 라이브러리 링크는 필요하지 않습니다. Windows API는 기본적으로 Windows 운영 체제에 포함되어 있으므로 별도의 라이브러리를 링크하지 않아도 됩니다.

Visual Studio와 GCC(MinGW) 모두 Windows API 함수가 기본적으로 포함되어 있어서, 별도의 라이브러리 옵션을 명시하지 않고도 컴파일할 수 있습니다.

gcc write_memory.c -o write_memory.exe
gcc read_memory.c -o read_memory.exe

 

1) 기초자산 Kospi200기준 선물,옵션추가

app.js
0.01MB
index.html
0.12MB

Node.js를 통한 Redis 실시간 데이타+조회(+로그인)
- Redis Search & RealTime Push(Exture3.0 Stock)
- Kse 추가
- Kosdaq 추가
- Elw,Etn,Etf 추가

1. 첫화면에서 로그인한다.
2. 로그인정보는 현재 클라이언트의 정보를 서버에 보낸다.
3. 서버에 정보를 보내면서, 동시에 Redis에 접속해서, 실시간데이타를 받아로도록 한다.
// Function to fetch data from Redis list using BLPOP (blocking pop)
async function fetchDataFromRedis() {
console.error('fetchDataFromRedis entered:[' + redisPublicKey + ']');

    try {
        const result = await redisClient.blPop(`QCS:${redisPublicKey}`, 0); // redisPublicKey 사용
        if (result) {
            const data = JSON.parse(result.element);
            return Array.isArray(data) ? data : [data]; // Ensure data is an array
        }
    } catch (err) {
        console.error('Error fetching data from Redis:', err);
    }
    return [];
}

// Polling Redis every second and sending data to WebSocket clients
setInterval(async () => {
    if (redisClient && redisPublicKey && redisPublicKey.length >= 4) { // Redis 클라이언트 연결 여부 체크
        const processedData = await fetchDataFromRedis();
        console.log('Sending data:', processedData); // Log the data being sent
        connectedClients.forEach((client) => {
            if (client.readyState === client.OPEN) {
                client.send(JSON.stringify(processedData));
            }
        });
    }
}, 1000); // 1 second interval
// Redis Public Key 설정 엔드포인트
app.post('/set-public-key', async (req, res) => {
    const { publicKey } = req.body;

    if (publicKey) {
        redisPublicKey = publicKey; // publicKey 업데이트
        console.log('Redis Public Key updated to:', redisPublicKey);
        await connectToRedis(); // Redis에 연결 시도(로그인시에)
        res.json({ message: 'Public Key updated successfully.' });
    } else {
        res.status(400).json({ error: 'Public Key is required.' });
    }
});


로그인후에 Node.js에서 Redis에 접속을 시도한다.)

- NODE.SERVER
- REDIS.TICKER.SERVER
- 실시간 PUSH & 조회

app.js
0.01MB
index.html
0.10MB

외부VPN을 통한 NODE.SERVER 조회

1) HOME.VPN.라우팅.설정(SK BROADBAND)

2) HOME.UBUNTU(LINUX) DESKTOP.CONTROL
2.1) REDIS.TICK.SERVER - SQLite조회해서, REDIS에 전송
2.2) REDIS에서 데이타 POP후에, WEB.BROWSER에 WEB.SOCKET으로 전송(REAL.TIME 데이타등)


3) 외부에서.VPN접속.설정후에.브라우져를 통한.조회

비고) WiseGuard VPN에 대해서


WireGuard VPN에서 PrivateKey와 PublicKey는 VPN 연결을 보안하고 암호화하는 데 중요한 역할을 합니다. 
이 두 키는 비대칭 암호화 방식을 따르며, 각 역할은 다음과 같습니다.

1. PrivateKey (개인 키)
PrivateKey는 각 클라이언트 또는 서버가 비밀로 유지해야 하는 개인 키입니다. 
이 키는 외부에 노출되지 않아야 하며, 오직 해당 장치에서만 사용됩니다.
암호화와 서명: 이 키를 사용하여 데이터를 암호화하거나 서명할 수 있습니다. 
PrivateKey로 암호화된 데이터는 해당 PrivateKey와 짝을 이루는 **PublicKey(공개 키)**로만 복호화할 수 있습니다.
WireGuard 설정: WireGuard 설정 파일에서 PrivateKey 항목에 개인 키가 포함됩니다. 이 키는 VPN 터널을 설정하는 데 사용됩니다.

2. PublicKey (공개 키)
PublicKey는 각 장치의 공개된 키로, 다른 장치들이 이 키를 사용해 해당 장치로 안전하게 통신할 수 있도록 합니다.
공유: PublicKey는 클라이언트와 서버 간에 공유됩니다. 
즉, 연결하려는 다른 장치에 이 공개 키를 제공하여 암호화된 데이터를 주고받을 수 있습니다.

WireGuard 설정: WireGuard 설정 파일에서 PublicKey는 각 피어(peer, 즉 통신 상대)의 공개 키를 나타냅니다. 이는 해당 피어와의 통신을 암호화하고 보장하는 역할을 합니다.

동작 방식

키 생성: 각 장치는 고유한 PrivateKey와 PublicKey 쌍을 생성합니다.

PublicKey 교환: 클라이언트와 서버는 서로의 PublicKey를 공유하여 암호화된 통신을 설정합니다.

데이터 암호화: 클라이언트는 서버의 PublicKey를 사용해 데이터를 암호화하고, 서버는 자신의 PrivateKey를 사용해 이 데이터를 복호화합니다. 
반대로 서버도 클라이언트의 PublicKey로 데이터를 암호화하고 클라이언트는 자신의 PrivateKey로 복호화합니다.
이렇게 PublicKey와 PrivateKey는 WireGuard VPN에서 데이터의 기밀성, 무결성 및 인증을 보장하는 핵심 요소로 작동합니다.


아래 명령을 사용하여 모든 .cs 파일에서 아스키 코드 123 ({)을 제거할 수 있습니다.

find 명령으로 찾은 .cs 파일들에서 아스키 코드 123 ({, 즉 16진수로는 7B)를 제거하려면, 다음과 같은 방법을 사용할 수 있습니다.

sed 사용)

아래 명령을 사용하여 모든 .cs 파일에서 아스키 코드 123 ({)을 제거할 수 있습니다.

find ./ -name "*.cs" -exec sed -i 's/\%x7B//g' {} +

비고) 문장전체를 바꿀때에
1)AddItemToList("QCS:" + queueName, jsonText);
2)AddItemToList("QCS:" + APMMemory.GetInstance.redisSenderQueueNM, jsonString);

find ./ -name "*.cs" -exec sed -i 's/AddItemToList("QCS:" + queueName, jsonText)/AddItemToList("QCS:" + APMMemory.GetInstance.redisSenderQueueNM, jsonString)/g' {} \;

현재 Text파일의 인코딩형식을 알려면)
B210145_BK@DESKTOP-QNNUCER MINGW64 ~/Downloads/NodeServer/redis_web_5_5_ticker/multiloginredistickserver
$ find ./ -name "*.cs" -exec file -i {} \;
./APMMemory.cs: text/x-c++; charset=utf-8
./APMSQLite.cs: text/x-c++; charset=us-ascii
./DataEncoding.cs: text/x-c++; charset=utf-8
./ExturePlusElw.cs: text/x-c++; charset=utf-8
./ExturePlusElwText.cs: text/x-c++; charset=utf-8
./ExturePlusFuture.cs: text/x-c++; charset=utf-8
./ExturePlusFutureText.cs: text/x-c++; charset=utf-8
./ExturePlusKosdaq.cs: text/x-c++; charset=utf-8
./ExturePlusKosdaqQuote10.cs: text/x-c++; charset=utf-8

인코딩변경)
./ExturePlusElwText.cs: text/x-c++; charset=utf-8
./ExturePlusFuture.cs: text/x-c++; charset=utf-8
./ExturePlusFutureText.cs: text/x-c++; charset=iso-8859-1
./ExturePlusFutureTextText.cs: text/x-c++; charset=iso-8859-1
./ExturePlusKosdaq.cs: text/x-c++; charset=utf-8
./ExturePlusKosdaqQuote10.cs: text/x-c++; charset=utf-8


find ./ -name "*.cs" -exec iconv -f utf-8 -t iso-8859-1 {} -o {}.tmp \; -exec mv {}.tmp {} \;

 

증권정보.홈페이지(Infra.Introduction)
1) 조회
2) 실시간

Ubuntu에서 Node.js를 설치하려면 다음 단계를 따르세요:

패키지 목록 업데이트:

sudo apt update
Node.js 설치: Node.js는 여러 방법으로 설치할 수 있지만, 가장 간편한 방법은 NodeSource PPA를 사용하는 것입니다. 다음 명령어를 실행하여 Node.js를 설치합니다.

curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs
위 명령어에서 setup_18.x는 Node.js의 최신 LTS 버전을 설치합니다. 다른 버전이 필요하다면, 해당 버전의 번호로 변경하세요.

설치 확인: 설치가 완료되면 Node.js와 npm(노드 패키지 관리자)이 제대로 설치되었는지 확인합니다.

node -v
npm -v
이제 Node.js와 npm이 정상적으로 설치되었습니다. 필요한 패키지를 설치하거나 프로젝트를 시작할 수 있습니다!

npm install express
npm install @redis/client
npm install ws

sinfo@sinfo:~$ netstat -an | grep 3000
tcp6       0      0 :::3000                 :::*                    LISTEN
sinfo@sinfo:~$

sudo ufw status
sudo ufw allow 3000
sudo ufw status
sudo ufw enable

sudo ufw allow 8080
sudo ufw status
sudo ufw enable


app.js 수정부분)

app.listen(port, '0.0.0.0', () => {
    console.log(`HTTP Server is running at http://0.0.0.0:${port}`);
});
const wss = new WebSocketServer({ port: 8080, host: '0.0.0.0' });
위의 수정으로 WebSocketServer도 모든 인터페이스에서 접속을 허용하게 됩니다.


index.html 수정부분)

<script>
    // ... (이전 코드)

    const ws = new WebSocket('ws://192.168.45.54:8080'); // 수정된 부분

    // ... (이후 코드)
</script>
이제 수정한 코드를 사용하여 index.html을 테스트해 보세요. 추가적인 질문이 있으면 언제든지 말씀해 주세요!


 

app.js
0.00MB
index.html
0.05MB

NODE.JS.SERVER를 이용한 조회/실시간 통합(4)

1. NODE.JS.SERVER를 이용한 SQLite조회 (3)버젼
2. NODE.JS.SERVER를 이용한 실시간데이타 반영 (2)버젼
3. NODE.JS.SERVER를 이용한 조회/실시간 통합(4)

1과 2를 3으로 통합할수 있는 핵심은, 1번의 주고받는 REDIS.QUEUE.NAME과
2번의 주고받는 REDIS.QUEUE.NAME의 PREFIX를 틀리게 운용하면 된다.

조회시에는
SEQRCHSEND:클라이언트고유키, SEQRCHRECV:클라이언트고유키
실시간에는
SEND:클라이언트고유키, RECV:클라이언트고유키

물론 REDIS에 데이타를 제공하는 REDIS.TICKER.SERVER또한 한쌍의 주고받는 부분의 로직이 추가되어야 한다.

개략적인구조)


여러개의.브라우져에서.각각.조회가.가능하며, 실시간 PUSH는 모든 브라우져에 적용된다.)


PUSH데이타.실시간.데이타화면)

버튼을 통해서 SQLite의 데이타를 가져오는 화면)

app.js
0.00MB
index.html
0.05MB

석수컴퓨터 학원에서는 아래와 같은 궁금증을 가지고 계신분들에게 온라인으로 가이드해드립니다.

1. KRX정보분배 데이타 포맷에 대해서 궁금하신분
2. KRX정보분배 데이타를 직접 받아보고 싶으신분(증권,파생,지수등)
3. KRX정보분배 데이타를 수신하기 위한 최적화되어진 TCP환경에 대해서 알고싶으신분
4. 데이타를 파싱을 위한 구조체 핸들링을 알고싶으신분(c,c#)
5. 데이타를 저장하는 방법을 알고싶으신분(MySQL, SQLite, REDIS)
6. KRX정보분배 데이타의 실시간 PUSH방법을 알고싶으신분(HTS,WTS등)
7. 위와 관련되어진 서버나 클라이언트에 대해서 궁금증을 가지고 계신분

xterm92@naver.com 으로 문의주시면 성심성의껏 답변드리겠습니다.

Node.Server/Index.HTML(2)+(3)

app.js
0.00MB
index.html
0.05MB

Node app.js 를 통한 REDIS에서 데이타 조회 (SQLite DataBase에 저장되어진 시세데이타를 불러오기, 실시간이 아님)

1. index.html에서 app.js로 데이타포맷 보내기(SQLite DataBase에 저장되어진 시세데이타를 불러오기, 실시간이 아님)
        async function sendData() {

            const data = {
                proto: "r",
                sender: "1127001637919216845106",
                id: "QUERY.0001574960.001",
                ts: new Date().toISOString(),
                method: "",
                query: "A301S",
                colcnt: ""
            };

            const response = await fetch('/send', {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json'
                },
                body: JSON.stringify(data)
            });
            const result = await response.json();
        }
2. REDIS에서 app.js 를 통한 JSON데이타 하나씩 꺼내오기
3  index.html에서 반복문을 통해서 하나씩 테이블에 출력
3.1 - index.html이 주된 메인이 되어서 control하므로, 반복문을 빠져나올수 있는 이벤트가 필요함
3.2 - JSON포맷중에 남은 항목에 서버에서 호출되어진 데이타의 Total개수를 표시
index++;
console.log(`Index: ${index}, Data Result: ${data.result}`);
if (data.result == index)
{
console.log(`Index: ${index}, Data Result: ${data.result}`);
console.log(`Index: ${index}, Data Result: ${data.result}`);
break;
}

4. 정상적으로 조회가 되는것을 확인

app.js
0.00MB
index.html
0.03MB

Node app.js 를 통한 REDIS에서 데이타 추출(삭제후에 꺼내오기)

개요)
- REDIS에 QUEUE에 매칭되어진 데이타가 쌓이면 실시간으로 NODE.js에서 이벤트.수신하여
웹브라우져와 통신하여, 브라우져에 표현해준다.(실시간.웹소켓)



app.js
- REDIS에서 데이타 추출(삭제후에 꺼내오기)
// Function to fetch data from Redis list using BLPOP (blocking pop)
async function fetchDataFromRedis() {
    try {
        const result = await redisClient.blPop('QCS:1127001637919216817849', 0); // 0 means it will block until data is available
        if (result) {
            // result is [key, value] where value is the data we want
            const data = JSON.parse(result.element);
            return Array.isArray(data) ? data : [data]; // Ensure data is an array
        }
    } catch (err) {
        console.error('Error fetching data from Redis:', err);
    }
    return [];
}

index.html 
- 웹소켓을 통한 데이타 표시


비고)
마지막에 입력되어진 데이타가 제일 위에 위치한다.
그러므로, 헤더의 타이틀과 맞아떨어질수 있다.


app.js
0.00MB
index.html
0.03MB

 

redis-cli에서 키가 리스트인지 확인하려면 TYPE 명령어를 사용하면 됩니다. Redis에서 특정 키의 데이터 유형을 확인할 수 있는 명령어입니다.

TYPE <key>

예시:

TYPE mylist

이 명령어는 해당 키가 리스트일 경우 list라는 값을 반환합니다.

나의 말:
127.0.0.1:6379> TYPE QCS:11270016379127001 list 127.0.0.1:6379> 리스트일경우 데이타 존재여부 확인하기
 

Redis에서 리스트에 데이터가 있는지 확인하려면 LLEN 명령어를 사용하여 해당 리스트의 길이를 확인할 수 있습니다. 길이가 0이면 데이터가 없다는 의미이고, 0보다 크면 데이터가 있다는 의미입니다.

LLEN <key>

예시:

LLEN QCS:11270016379127001

이 명령어는 리스트의 요소 개수를 반환합니다. 반환 값이 0이면 리스트에 데이터가 없는 것이고, 0보다 크면 데이터가 존재하는 것입니다.

 
 

Redis에서 리스트의 데이터를 확인하려면 LRANGE 명령어를 사용합니다. 이 명령어는 리스트의 특정 범위 내에 있는 요소들을 반환합니다.

형식:

LRANGE <key> <start> <stop>
  • start: 시작 인덱스 (0부터 시작)
  • stop: 끝 인덱스 (-1은 리스트의 마지막 요소까지를 의미)

예시로, 리스트의 모든 데이터를 확인하려면:

LRANGE QCS:11270016379127001 0 -1

이 명령어는 리스트 QCS:11270016379127001의 모든 요소를 반환합니다.


127.0.0.1:6379> TYPE QCS:11270016379127001
list
127.0.0.1:6379> LLEN QCS:11270016379127001
(integer) 63
127.0.0.1:6379>
127.0.0.1:6379> LRANGE QCS:11270016379127001 0 -1
 1) "{\"proto\":\"response/json\",\"sender\":\"11270016379127001\",\"id\":null,\"ts\":\"[2024-09-30 08:31:04.523]\",\"method\":\"realkrx\",\"query\":\"A301S\",\"data\":\"{\\\"dataClass\\\":\\\"A3\\\",\\\"infoMarketClass\\\":\\\"01S\\\",\\\"distributeStockIndex\\\":\\\"        \\\",\\\"boardID\\\":\\\"G1\\\",\\\"sessionID\\\":\\\"40\\\",\\\"stockCode\\\":\\\"KR7005930003\\\",\\\"stockSeq\\\":\\\"000379\\\",\\\"transactionProcessingTime\\\":\\\"090016340616\\\",\\\"upDown\\\":\\\"2\\\",\\\"gap\\\":\\\"00000000600\\\",\\\"tradePrice\\\":\\\"00000065900\\\",\\\"tradeVolume\\\":\\\"0000000014\\\",\\\"openPrice\\\":\\\"00000065900\\\",\\\"highPrice\\\":\\\"00000066000\\\",\\\"lowPrice\\\":\\\"00000065800\\\",\\\"accmTradeVolume\\\":\\\"000000740706\\\",\\\"accmTradeAmount\\\":\\\"000000048808907100.000\\\",\\\"lastAskBidClassCode\\\":\\\"1\\\",\\\"LPHoldingVolume\\\":\\\"000000000000000\\\",\\\"askOneQuote\\\":\\\"00000066000\\\",\\\"bidOneQuote\\\":\\\"00000065900\\\",\\\"endText\\\":\\\"NULL\\\"}\",\"result\":\"SUCC\"}"
 2) "{\"proto\":\"response/json\",\"sender\":\"11270016379127001\",\"id\":null,\"ts\":\"[2024-09-30 08:31:04.541]\",\"method\":\"realkrx\",\"query\":\"A301S\",\"data\":\"{\\\"dataClass\\\":\\\"A3\\\",\\\"infoMarketClass\\\":\\\"01S\\\",\\\"distributeStockIndex\\\":\\\"        \\\",\\\"boardID\\\":\\\"G1\\\",\\\"sessionID\\\":\\\"40\\\",\\\"stockCode\\\":\\\"KR7005930003\\\",\\\"stockSeq\\\":\\\"000379\\\",\\\"transactionProcessingTime\\\":\\\"090203148634\\\",\\\"upDown\\\":\\\"2\\\",\\\"gap\\\":\\\"00000000300\\\",\\\"tradePrice\\\":\\\"00000065600\\\",\\\"tradeVolume\\\":\\\"0000000001\\\",\\\"openPrice\\\":\\\"00000065900\\\",\\\"highPrice\\\":\\\"00000066000\\\",\\\"lowPrice\\\":\\\"00000065600\\\",\\\"accmTradeVolume\\\":\\\"000001311321\\\",\\\"accmTradeAmount\\\":\\\"000000086341981200.000\\\",\\\"lastAskBidClassCode\\\":\\\"1\\\",\\\"LPHoldingVolume\\\":\\\"000000000000000\\\",\\\"askOneQuote\\\":\\\"00000065700\\\",\\\"bidOneQuote\\\":\\\"00000065600\\\",\\\"endText\\\":\\\"NULL\\\"}\",\"result\":\"SUCC\"}"
 3) "{\"proto\":\"response/json\",\"sender\":\"11270016379127001\",\"id\":null,\"ts\":\"[2024-09-30 08:31:04.556]\",\"method\":\"realkrx\",\"query\":\"A301S\",\"data\":\"{\\\"dataClass\\\":\\\"A3\\\",\\\"infoMarketClass\\\":\\\"01S\\\",\\\"distributeStockIndex\\\":\\\"        \\\",\\\"boardID\\\":\\\"G1\\\",\\\"sessionID\\\":\\\"40\\\",\\\"stockCode\\\":\\\"KR7005930003\\\",\\\"stockSeq\\\":\\\"000379\\\",\\\"transactionProcessingTime\\\":\\\"090423001705\\\",\\\"upDown\\\":\\\"2\\\",\\\"gap\\\":\\\"00000000400\\\",\\\"tradePrice\\\":\\\"00000065700\\\",\\\"tradeVolume\\\":\\\"0000000001\\\",\\\"openPrice\\\":\\\"00000065900\\\",\\\"highPrice\\\":\\\"00000066000\\\",\\\"lowPrice\\\":\\\"00000065600\\\",\\\"accmTradeVolume\\\":\\\"000001580913\\\",\\\"accmTradeAmount\\\":\\\"000000104057729600.000\\\",\\\"lastAskBidClassCode\\\":\\\"1\\\",\\\"LPHoldingVolume\\\":\\\"000000000000000\\\",\\\"askOneQuote\\\":\\\"00000000000\\\",\\\"bidOneQuote\\\":\\\"00000000000\\\",\\\"endText\\\":\\\"NULL\\\"}\",\"result\":\"SUCC\"}"
 4) "{\"proto\":\"response/json\",\"sender\":\"11270016379127001\",\"id\":null,\"ts\":\"[2024-09-30 08:31:04.575]\",\"method\":\"realkrx\",\"query\":\"A301S\",\"data\":\"{\\\"dataClass\\\":\\\"A3\\\",\\\"infoMarketClass\\\":\\\"01S\\\",\\\"distributeStockIndex\\\":\\\"        \\\",\\\"boardID\\\":\\\"G1\\\",\\\"sessionID\\\":\\\"40\\\",\\\"stockCode\\\":\\\"KR7005930003\\\",\\\"stockSeq\\\":\\\"000379\\\",\\\"transactionProcessingTime\\\":\\\"090645718364\\\",\\\"upDown\\\":\\\"2\\\",\\\"gap\\\":\\\"00000000500\\\",\\\"tradePrice\\\":\\\"00000065800\\\",\\\"tradeVolume\\\":\\\"0000000014\\\",\\\"openPrice\\\":\\\"00000065900\\\",\\\"highPrice\\\":\\\"00000066000\\\",\\\"lowPrice\\\":\\\"00000065600\\\",\\\"accmTradeVolume\\\":\\\"000002214961\\\",\\\"accmTradeAmount\\\":\\\"000000145771622700.000\\\",\\\"lastAskBidClassCode\\\":\\\"2\\\",\\\"LPHoldingVolume\\\":\\\"000000000000000\\\",\\\"askOneQuote\\\":\\\"00000065800\\\",\\\"bidOneQuote\\\":\\\"00000065700\\\",\\\"endText\\\":\\\"NULL\\\"}\",\"result\":\"SUCC\"}"
 5) "{\"proto\":\"response/json\",\"sender\":\"11270016379127001\",\"id\":null,\"ts\":\"[2024-09-30 08:31:04.596]\",\"method\":\"realkrx\",\"query\":\"A301S\",\"data\":\"{\\\"dataClass\\\":\\\"A3\\\",\\\"infoMarketClass\\\":\\\"01S\\\",\\\"distributeStockIndex\\\":\\\"        \\\",\\\"boardID\\\":\\\"G1\\\",\\\"sessionID\\\":\\\"40\\\",\\\"stockCode\\\":\\\"KR7005930003\\\",\\\"stockSeq\\\":\\\"000379\\\",\\\"transactionProcessingTime\\\":\\\"091029485349\\\",\\\"upDown\\\":\\\"2\\\",\\\"gap\\\":\\\"00000000200\\\",\\\"tradePrice\\\":\\\"00000065500\\\",\\\"tradeVolume\\\":\\\"0000000005\\\",\\\"openPrice\\\":\\\"00000065900\\\",\\\"highPrice\\\":\\\"00000066000\\\",\\\"lowPrice\\\":\\\"00000065400\\\",\\\"accmTradeVolume\\\":\\\"000002682855\\\",\\\"accmTradeAmount\\\":\\\"000000176459947500.000\\\",\\\"lastAskBidClassCode\\\":\\\"1\\\",\\\"LPHoldingVolume\\\":\\\"000000000000000\\\",\\\"askOneQuote\\\":\\\"00000065600\\\",\\\"bidOneQuote\\\":\\\"00000065500\\\",\\\"endText\\\":\\\"NULL\\\"}\",\"result\":\"SUCC\"}"
 6) "{\"proto\":\"response/json\",\"sender\":\"11270016379127001\",\"id\":null,\"ts\":\"[2024-09-30 08:31:04.650]\",\"method\":\"realkrx\",\"query\":\"A301S\",\"data\":\"{\\\"dataClass\\\":\\\"A3\\\",\\\"infoMarketClass\\\":\\\"01S\\\",\\\"distributeStockIndex\\\":\\\"        \\\",\\\"boardID\\\":\\\"G1\\\",\\\"sessionID\\\":\\\"40\\\",\\\"stockCode\\\":\\\"KR7005930003\\\",\\\"stockSeq\\\":\\\"000379\\\",\\\"transactionProcessingTime\\\":\\\"091358828653\\\",\\\"upDown\\\":\\\"2\\\",\\\"gap\\\":\\\"00000000200\\\",\\\"tradePrice\\\":\\\"00000065500\\\",\\\"tradeVolume\\\":\\\"0000000002\\\",\\\"openPrice\\\":\\\"00000065900\\\",\\\"highPrice\\\":\\\"00000066000\\\",\\\"lowPrice\\\":\\\"00000065400\\\",\\\"accmTradeVolume\\\":\\\"000003115219\\\",\\\"accmTradeAmount\\\":\\\"000000204794064000.000\\\",\\\"lastAskBidClassCode\\\":\\\"1\\\",\\\"LPHoldingVolume\\\":\\\"000000000000000\\\",\\\"askOneQuote\\\":\\\"00000000000\\\",\\\"bidOneQuote\\\":\\\"00000000000\\\",\\\"endText\\\":\\\"NULL\\\"}\",\"result\":\"SUCC\"}"
 7) "{\"proto\":\"response/json\",\"sender\":\"11270016379127001\",\"id\":null,\"ts\":\"[2024-09-30 08:31:04.712]\",\"method\":\"realkrx\",\"query\":\"A301S\",\"data\":\"{\\\"dataClass\\\":\\\"A3\\\",\\\"infoMarketClass\\\":\\\"01S\\\",\\\"distributeStockIndex\\\":\\\"        \\\",\\\"boardID\\\":\\\"G1\\\",\\\"sessionID\\\":\\\"40\\\",\\\"stockCode\\\":\\\"KR7005930003\\\",\\\"stockSeq\\\":\\\"000379\\\",\\\"transactionProcessingTime\\\":\\\"091825878686\\\",\\\"upDown\\\":\\\"2\\\",\\\"gap\\\":\\\"00000000200\\\",\\\"tradePrice\\\":\\\"00000065500\\\",\\\"tradeVolume\\\":\\\"0000000093\\\",\\\"openPrice\\\":\\\"00000065900\\\",\\\"highPrice\\\":\\\"00000066000\\\",\\\"lowPrice\\\":\\\"00000065400\\\",\\\"accmTradeVolume\\\":\\\"000003385914\\\",\\\"accmTradeAmount\\\":\\\"000000222525294200.000\\\",\\\"lastAskBidClassCode\\\":\\\"1\\\",\\\"LPHoldingVolume\\\":\\\"000000000000000\\\",\\\"askOneQuote\\\":\\\"00000065600\\\",\\\"bidOneQuote\\\":\\\"00000065500\\\",\\\"endText\\\":\\\"NULL\\\"}\",\"result\":\"SUCC\"}"
 8) "{\"proto\":\"response/json\",\"sender\":\"11270016379127001\",\"id\":null,\"ts\":\"[2024-09-30 08:31:04.774]\",\"method\":\"realkrx\",\"query\":\"A301S\",\"data\":\"{\\\"dataClass\\\":\\\"A3\\\",\\\"infoMarketClass\\\":\\\"01S\\\",\\\"distributeStockIndex\\\":\\\"        \\\",\\\"boardID\\\":\\\"G1\\\",\\\"sessionID\\\":\\\"40\\\",\\\"stockCode\\\":\\\"KR7005930003\\\",\\\"stockSeq\\\":\\\"000379\\\",\\\"transactionProcessingTime\\\":\\\"092352815143\\\",\\\"upDown\\\":\\\"2\\\",\\\"gap\\\":\\\"00000000200\\\",\\\"tradePrice\\\":\\\"00000065500\\\",\\\"tradeVolume\\\":\\\"0000000004\\\",\\\"openPrice\\\":\\\"00000065900\\\",\\\"highPrice\\\":\\\"00000066000\\\",\\\"lowPrice\\\":\\\"00000065400\\\",\\\"accmTradeVolume\\\":\\\"000003808293\\\",\\\"accmTradeAmount\\\":\\\"000000250189888900.000\\\",\\\"lastAskBidClassCode\\\":\\\"1\\\",\\\"LPHoldingVolume\\\":\\\"000000000000000\\\",\\\"askOneQuote\\\":\\\"00000065600\\\",\\\"bidOneQuote\\\":\\\"00000065500\\\",\\\"endText\\\":\\\"NULL\\\"}\",\"result\":\"SUCC\"}"
 9) "{\"proto\":\"response/json\",\"sender\":\"11270016379127001\",\"id\":null,\"ts\":\"[2024-09-30 08:31:04.828]\",\"method\":\"realkrx\",\"query\":\"A301S\",\"data\":\"{\\\"dataClass\\\":\\\"A3\\\",\\\"infoMarketClass\\\":\\\"01S\\\",\\\"distributeStockIndex\\\":\\\"        \\\",\\\"boardID\\\":\\\"G1\\\",\\\"sessionID\\\":\\\"40\\\",\\\"stockCode\\\":\\\"KR7005930003\\\",\\\"stockSeq\\\":\\\"000379\\\",\\\"transactionProcessingTime\\\":\\\"092833652644\\\",\\\"upDown\\\":\\\"2\\\",\\\"gap\\\":\\\"00000000100\\\",\\\"tradePrice\\\":\\\"00000065400\\\",\\\"tradeVolume\\\":\\\"0000000001\\\",\\\"openPrice\\\":\\\"00000065900\\\",\\\"highPrice\\\":\\\"00000066000\\\",\\\"lowPrice\\\":\\\"00000065400\\\",\\\"accmTradeVolume\\\":\\\"000003989750\\\",\\\"accmTradeAmount\\\":\\\"000000262063533100.000\\\",\\\"lastAskBidClassCode\\\":\\\"1\\\",\\\"LPHoldingVolume\\\":\\\"000000000000000\\\",\\\"askOneQuote\\\":\\\"00000000000\\\",\\\"bidOneQuote\\\":\\\"00000000000\\\",\\\"endText\\\":\\\"NULL\\\"}\",\"result\":\"SUCC\"}"
10) "{\"proto\":\"response/json\",\"sender\":\"11270016379127001\",\"id\":null,\"ts\":\"[2024-09-30 08:31:04.894]\",\"method\":\"realkrx\",\"query\":\"A301S\",\"data\":\"{\\\"dataClass\\\":\\\"A3\\\",\\\"infoMarketClass\\\":\\\"01S\\\",\\\"distributeStockIndex\\\":\\\"        \\\",\\\"boardID\\\":\\\"G1\\\",\\\"sessionID\\\":\\\"40\\\",\\\"stockCode\\\":\\\"KR7005930003\\\",\\\"stockSeq\\\":\\\"000379\\\",\\\"transactionProcessingTime\\\":\\\"093141775147\\\",\\\"upDown\\\":\\\"2\\\",\\\"gap\\\":\\\"00000000100\\\",\\\"tradePrice\\\":\\\"00000065400\\\",\\\"tradeVolume\\\":\\\"0000000001\\\",\\\"openPrice\\\":\\\"00000065900\\\",\\\"highPrice\\\":\\\"00000066000\\\",\\\"lowPrice\\\":\\\"00000065300\\\",\\\"accmTradeVolume\\\":\\\"000004124641\\\",\\\"accmTradeAmount\\\":\\\"000000270882461600.000\\\",\\\"lastAskBidClassCode\\\":\\\"2\\\",\\\"LPHoldingVolume\\\":\\\"000000000000000\\\",\\\"askOneQuote\\\":\\\"00000065400\\\",\\\"bidOneQuote\\\":\\\"00000065300\\\",\\\"endText\\\":\\\"NULL\\\"}\",\"result\":\"SUCC\"}"
11) "{\"proto\":\"response/json\",\"sender\":\"11270016379127001\",\"id\":null,\"ts\":\"[2024-09-30 08:31:04.954]\",\"method\":\"realkrx\",\"query\":\"A301S\",\"data\":\"{\\\"dataClass\\\":\\\"A3\\\",\\\"infoMarketClass\\\":\\\"01S\\\",\\\"distributeStockIndex\\\":\\\"        \\\",\\\"boardID\\\":\\\"G1\\\",\\\"sessionID\\\":\\\"40\\\",\\\"stockCode\\\":\\\"KR7005930003\\\",\\\"stockSeq\\\":\\\"000379\\\",\\\"transactionProcessingTime\\\":\\\"093441844187\\\",\\\"upDown\\\":\\\"3\\\",\\\"gap\\\":\\\"00000000000\\\",\\\"tradePrice\\\":\\\"00000065300\\\",\\\"tradeVolume\\\":\\\"0000000018\\\",\\\"openPrice\\\":\\\"00000065900\\\",\\\"highPrice\\\":\\\"00000066000\\\",\\\"lowPrice\\\":\\\"00000065300\\\",\\\"accmTradeVolume\\\":\\\"000004150310\\\",\\\"accmTradeAmount\\\":\\\"000000272560309900.000\\\",\\\"lastAskBidClassCode\\\":\\\"1\\\",\\\"LPHoldingVolume\\\":\\\"000000000000000\\\",\\\"askOneQuote\\\":\\\"00000065400\\\",\\\"bidOneQuote\\\":\\\"00000065300\\\",\\\"endText\\\":\\\"NULL\\\"}\",\"result\":\"SUCC\"}"
12) "{\"proto\":\"response/json\",\"sender\":\"11270016379127001\",\"id\":null,\"ts\":\"[2024-09-30 08:31:05.021]\",\"method\":\"realkrx\",\"query\":\"A301S\",\"data\":\"{\\\"dataClass\\\":\\\"A3\\\",\\\"infoMarketClass\\\":\\\"01S\\\",\\\"distributeStockIndex\\\":\\\"        \\\",\\\"boardID\\\":\\\"G1\\\",\\\"sessionID\\\":\\\"40\\\",\\\"stockCode\\\":\\\"KR7005930003\\\",\\\"stockSeq\\\":\\\"000379\\\",\\\"transactionProcessingTime\\\":\\\"093902993906\\\",\\\"upDown\\\":\\\"3\\\",\\\"gap\\\":\\\"00000000000\\\",\\\"tradePrice\\\":\\\"00000065300\\\",\\\"tradeVolume\\\":\\\"0000000003\\\",\\\"openPrice\\\":\\\"00000065900\\\",\\\"highPrice\\\":\\\"00000066000\\\",\\\"lowPrice\\\":\\\"00000065300\\\",\\\"accmTradeVolume\\\":\\\"000004207435\\\",\\\"accmTradeAmount\\\":\\\"000000276294077300.000\\\",\\\"lastAskBidClassCode\\\":\\\"1\\\",\\\"LPHoldingVolume\\\":\\\"000000000000000\\\",\\\"askOneQuote\\\":\\\"00000065400\\\",\\\"bidOneQuote\\\":\\\"00000065300\\\",\\\"endText\\\":\\\"NULL\\\"}\",\"result\":\"SUCC\"}"



Windows에서 Node.js 서버를 실행하고 클라이언트 측에서 실시간 데이터를 확인하는 방법은 여러 가지가 있습니다. 여기서는 기본적인 설정 방법과 함께 Socket.IO를 이용한 실시간 데이터 전송 예제를 소개하겠습니다.

1. Node.js 설치

먼저 Node.js를 설치해야 합니다. Node.js 공식 웹사이트에서 설치 파일을 다운로드하여 설치합니다.

2. 새로운 Node.js 프로젝트 생성

터미널 또는 명령 프롬프트를 열고, 프로젝트 디렉토리를 생성한 후 이동합니다.

bash
코드 복사
mkdir my-node-server cd my-node-server npm init -y

3. 필요한 패키지 설치

Express와 Socket.IO를 설치합니다.

bash
코드 복사
npm install express socket.io


아래는 Node.js 서버를 실행하고 클라이언트 측에서 실시간 데이터를 확인하는 방법입니다.

4. 프로젝트 구조 만들기

먼저, 프로젝트 폴더를 설정합니다. 아래와 같은 구조를 만들어 주세요:

csharp
코드 복사
redis_web_4_1_ticker/
├── app.js # 서버 측 코드
└── public/
└── index.html # 클라이언트 측 HTML

    4.1. app.js 파일 설정

app.js 파일에 아래 코드를 입력하세요:

    4.2. index.html 파일 설정

public/index.html 파일에 아래 코드를 입력하세요:

    4.3. 프로젝트에 필요한 패키지 설치

프로젝트 폴더에서 터미널(명령 프롬프트)을 열고 다음 명령어를 실행하여 필요한 패키지를 설치합니다:

npm init -y npm install express @redis/client ws

5. Redis 서버 실행

Redis 서버가 실행되고 있는지 확인하세요. Redis 서버가 설치되어 있어야 하고, 실행 중이어야 합니다. 만약 Redis가 설치되지 않았다면, Redis 설치 가이드를 참고하세요.

6. Node.js 서버 실행

터미널에서 다음 명령어를 실행하여 Node.js 서버를 시작합니다:

 
node app.js

서버가 성공적으로 시작되면 다음과 같은 메시지가 표시됩니다:
HTTP Server is running at http://localhost:3000

7. 클라이언트 웹 페이지 열기

웹 브라우저를 열고 다음 URL로 이동합니다:

 
http://localhost:3000/

이제 웹 페이지가 열리고, Redis에서 데이터를 수신하여 테이블에 표시하는 것을 확인할 수 있습니다.
REDIS시세 데이타 단순조회)

 

 

 


화면) 노드서버 실행

app.js
0.00MB
index.html
0.03MB

Windows에서 C# 프로젝트를 설정하고 빌드하는 과정은 다음과 같습니다.(Linux와 동일절차임)
Windows에서 C# 프로젝트를 설정하고 빌드하는 과정은 다음과 같습니다.(Linux와 동일절차임)
Windows에서 C# 프로젝트를 설정하고 빌드하는 과정은 다음과 같습니다.(Linux와 동일절차임)



1. .NET SDK 설치(Windows에서는 파일로 설치)
1. .NET SDK 설치(Windows에서는 파일로 설치)
1. .NET SDK 설치(Windows에서는 파일로 설치)
1. .NET SDK 설치(Windows에서는 파일로 설치)

패키지 목록 업데이트 및 필수 패키지 설치
sudo apt update
sudo apt install -y wget apt-transport-https software-properties-common
wget https://packages.microsoft.com/keys/microsoft.asc
sudo apt-key add microsoft.asc
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/ubuntu/20.04/prod focal main" > /etc/apt/sources.list.d/dotnetdev.list'

2. .NET SDK 설치(Windows에서는 파일로 설치)
2. .NET SDK 설치(Windows에서는 파일로 설치)
2. .NET SDK 설치(Windows에서는 파일로 설치)
2. .NET SDK 설치(Windows에서는 파일로 설치)
2. .NET SDK 설치(Windows에서는 파일로 설치)

sudo apt update
sudo apt install -y dotnet-sdk-7.0

설치 확인
dotnet --version


\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker>dotnet new console -o mdiwebrowser

.NET 8.0을(를) 시작합니다.
---------------------
SDK 버전: 8.0.402

원격 분석
---------
.NET 도구는 사용자 환경 개선을 위해 사용량 현황 데이터를 수집합니다. Microsoft에서 데이터를 수집하여 커뮤니티와 공유합니다. 원하는 셸을 사용하여 DOTNET_CLI_TELEMETRY_OPTOUT 환경  변수를 '1' 또는 'true'로 설정하여 원격 분석을 옵트아웃할 수 있습니다.

.NET CLI 도구 원격 분석에 대한 자세한 내용은 https://aka.ms/dotnet-cli-telemetry를 참조하세요.

----------------
ASP.NET Core HTTPS 개발 인증서를 설치했습니다.
인증서를 신뢰하려면 'dotnet dev-certs https --trust'를 실행하세요.
HTTPS에 관한 자세한 정보: https://aka.ms/dotnet-https

----------------
첫 번째 앱 작성: https://aka.ms/dotnet-hello-world
새로운 기능 확인: https://aka.ms/dotnet-whats-new
설명서 살펴보기: https://aka.ms/dotnet-docs
GitHub에서 문제 보고 및 소스 찾기: https://github.com/dotnet/core
사용 가능한 명령을 보려면 'dotnet --help'를 사용하거나 https://aka.ms/dotnet-cli를 방문하세요.
--------------------------------------------------------------------------------------
"콘솔 앱" 템플릿이 성공적으로 생성되었습니다.

생성 후 작업 처리 중...
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj 복원 중:
  복원할 프로젝트를 확인하는 중...
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj : warning NU1803: 'http://nuget.grapecity.com/nuget' 'HTTP' 원본을 사용하여 'restore' 작업 을 실행하고 있습
니다. 비 HTTPS 액세스는 이후 버전에서 제거됩니다. 'HTTPS' 원본으로 마이그레이션하는 것이 좋습니다.
  C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj을(를) 110밀리초 동안 복원했습니다.
복원에 성공했습니다.



C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker>
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker 디렉터리

2024-09-26  오전 08:08    

          .


2024-09-26  오전 08:08    

          ..


2024-09-26  오전 08:08    

          mdiwebrowser


               0개 파일                   0 바이트
               3개 디렉터리  17,577,447,424 바이트 남음

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker>
C:\Users\B210145_BK\Downloads\exture_4_3_ubuntu_ticker\multipleredistickerserver>
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\MultipleRedisManager.cs(47,17): error CS0246: 'RedisClient' 형식 또는 네임스페이스 이름을 찾을 수 없습니다. using 지시문 또는 어셈블리 참조가
있는지 확인하세요. [C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj]
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\MultipleRedisManager.cs(48,10): error CS0246: 'RedisClient' 형식 또는 네임스페이스 이름을 찾을 수 없습니다. using 지시문 또는 어셈블리 참조가
있는지 확인하세요. [C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj]
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\PublicApiNM.cs(229,77): error CS0246: 'SQLiteConnection' 형식 또는 네임스페이스 이름을 찾을 수 없습니다. using 지시문 또는 어셈블리 참조가 있는지
 확인하세요. [C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj]
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\PublicDataApiNM.cs(60,67): error CS0246: 'SQLiteConnection' 형식 또는 네임스페이스 이름을 찾을 수 없습니다. using 지시문 또는 어셈블리 참조가
있는지 확인하세요. [C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj]
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\SelectDataSQLite.cs(23,41): error CS0246: 'SQLiteConnection' 형식 또는 네임스페이스 이름을 찾을 수 없습니다. using 지시문 또는 어셈블리 참조가
 있는지 확인하세요. [C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj]
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\SelectDataSQLite.cs(48,59): error CS0246: 'SQLiteConnection' 형식 또는 네임스페이스 이름을 찾을 수 없습니다. using 지시문 또는 어셈블리 참조가
 있는지 확인하세요. [C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj]
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\SelectDataSQLite.cs(110,75): error CS0246: 'SQLiteConnection' 형식 또는 네임스페이스 이름을 찾을 수 없습니다. using 지시문 또는 어셈블리 참조
가 있는지 확인하세요. [C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj]
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\SelectDataSQLite.cs(161,98): error CS0246: 'SQLiteConnection' 형식 또는 네임스페이스 이름을 찾을 수 없습니다. using 지시문 또는 어셈블리 참조
가 있는지 확인하세요. [C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj]
    경고 2개
    오류 42개

경과 시간: 00:00:05.13

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser>
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser>dotnet add package Newtonsoft.Json
  복원할 프로젝트를 확인하는 중...
  Writing C:\Users\B210145_BK\AppData\Local\Temp\tmp0oxzu2.tmp
info : X.509 인증서 체인 유효성 검사는 코드 서명에 .NET에서 선택한 기본 신뢰 저장소를 사용합니다.
info : X.509 인증서 체인 유효성 검사는 타임스탬프에 .NET에서 선택한 기본 신뢰 저장소를 사용합니다.
info : 'C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj' 프로젝트에 'Newtonsoft.Json' 패키지에 대한 PackageReference를 추가하는 중입니다.
info :   GET https://api.nuget.org/v3/registration5-gz-semver2/newtonsoft.json/index.json
info :   OK https://api.nuget.org/v3/registration5-gz-semver2/newtonsoft.json/index.json 809밀리초
info :   GET https://www.nuget.org/api/v2/FindPackagesById()?id='Newtonsoft.Json'&semVerLevel=2.0.0
info :   OK https://www.nuget.org/api/v2/FindPackagesById()?id='Newtonsoft.Json'&semVerLevel=2.0.0 434밀리초
warn : NU1803: 'http://nuget.grapecity.com/nuget' 'HTTP' 원본을 사용하여 'restore' 작업을 실행하고 있습니다. 비 HTTPS 액세스는 이후 버전에서 제거됩니다. 'HTTPS' 원본으로 마이그레 이션하는 것이 좋습니다.
info : C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj의 패키지를 복원하는 중...
info :   GET https://api.nuget.org/v3/vulnerabilities/index.json
info :   OK https://api.nuget.org/v3/vulnerabilities/index.json 279밀리초
info :   GET https://api.nuget.org/v3-vulnerabilities/2024.09.24.23.37.09/vulnerability.base.json
info :   GET https://api.nuget.org/v3-vulnerabilities/2024.09.24.23.37.09/2024.09.25.17.37.11/vulnerability.update.json
info :   OK https://api.nuget.org/v3-vulnerabilities/2024.09.24.23.37.09/vulnerability.base.json 187밀리초
info :   OK https://api.nuget.org/v3-vulnerabilities/2024.09.24.23.37.09/2024.09.25.17.37.11/vulnerability.update.json 410밀리초
info : 'Newtonsoft.Json' 패키지는 'C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj' 프로젝트에 지정된 모든 프레임워크와 호환됩니다.
info : 'Newtonsoft.Json' 패키지 '13.0.3' 버전에 대한 PackageReference가 'C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj' 파일에 추가되었습니다.
info : 자산 파일을 디스크에 쓰는 중입니다. 경로: C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\obj\project.assets.json
log  : C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj을(를) 900밀리초 동안 복원했습니다.

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser>
dotnet add package Newtonsoft.Json
dotnet add package ServiceStack.Redis
dotnet add package Systehttp://m.Data.SQLite

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser>dotnet build
  복원할 프로젝트를 확인하는 중...
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj : warning NU1803: 'http://nuget.grapecity.com/nuget' 'HTTP' 원본을 사용하여 'restore' 작업 을 실행하고 있습
니다. 비 HTTPS 액세스는 이후 버전에서 제거됩니다. 'HTTPS' 원본으로 마이그레이션하는 것이 좋습니다.
  복원할 모든 프로젝트가 최신 상태입니다.
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj : warning NU1803: 'http://nuget.grapecity.com/nuget' 'HTTP' 원본을 사용하여 'restore' 작업 을 실행하고 있습
니다. 비 HTTPS 액세스는 이후 버전에서 제거됩니다. 'HTTPS' 원본으로 마이그레이션하는 것이 좋습니다.
  mdiwebrowser -> C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\bin\Debug\net8.0\mdiwebrowser.dll

빌드했습니다.

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj : warning NU1803: 'http://nuget.grapecity.com/nuget' 'HTTP' 원본을 사용하여 'restore' 작업 을 실행하고 있습
니다. 비 HTTPS 액세스는 이후 버전에서 제거됩니다. 'HTTPS' 원본으로 마이그레이션하는 것이 좋습니다.
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj : warning NU1803: 'http://nuget.grapecity.com/nuget' 'HTTP' 원본을 사용하여 'restore' 작업 을 실행하고 있습
니다. 비 HTTPS 액세스는 이후 버전에서 제거됩니다. 'HTTPS' 원본으로 마이그레이션하는 것이 좋습니다.
    경고 2개
    오류 0개

경과 시간: 00:00:01.66

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser>
 C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser 디렉터리

2024-09-26  오전 08:09    

          .


2024-09-26  오전 08:09    

          ..


2024-09-26  오전 08:09    

          bin


2024-09-26  오전 08:11    

          obj


              34개 파일           1,559,700 바이트
               4개 디렉터리  17,472,671,744 바이트 남음

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser>
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser>mkdir reference

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser>cd reference

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\reference>copy "C:\Users\B210145_BK\Downloads\exture_4_3_ubuntu_ticker\multipleredistickerserver\Service*.DLL" .
C:\Users\B210145_BK\Downloads\exture_4_3_ubuntu_ticker\multipleredistickerserver\ServiceStack.dll
C:\Users\B210145_BK\Downloads\exture_4_3_ubuntu_ticker\multipleredistickerserver\ServiceStack.Interfaces.dll
C:\Users\B210145_BK\Downloads\exture_4_3_ubuntu_ticker\multipleredistickerserver\ServiceStack.ServiceInterface.dll
        3개 파일이 복사되었습니다.

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\reference>


C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\bin\Debug\net8.0 디렉터리

2024-09-11  오후 09:29         1,040,384 ServiceStack.Common.dll
2024-09-11  오후 09:29           425,984 ServiceStack.Interfaces.dll
2024-09-11  오후 09:30           902,144 ServiceStack.Redis.dll
2024-09-11  오후 09:32           760,320 ServiceStack.Text.dll

2024-09-26  오전 08:12    

          .


2024-09-26  오전 08:12    

          ..


2020-04-17  오전 05:38         4,977,744 EntityFramework.dll
2020-04-17  오전 05:39           591,440 EntityFramework.SqlServer.dll
2024-09-26  오전 08:12            21,704 mdiwebrowser.deps.json
2024-09-26  오전 08:12           895,488 mdiwebrowser.dll
2024-09-26  오전 08:12           138,752 mdiwebrowser.exe
2024-09-26  오전 08:12           104,068 mdiwebrowser.pdb
2024-09-26  오전 08:12               268 mdiwebrowser.runtimeconfig.json
2019-11-15  오후 05:36            23,112 Microsoft.Win32.SystemEvents.dll
2023-03-08  오후 04:09           712,464 Newtonsoft.Json.dll
2024-09-26  오전 08:12    

          runtimes


2019-11-15  오후 05:36           181,832 Systehttp://m.CodeDom.dll
2019-11-15  오후 05:37           375,912 Systehttp://m.Configuration.ConfigurationManager.dll
2020-01-18  오전 03:28           267,136 Systehttp://m.Data.SqlClient.dll
2023-06-11  오전 06:02           427,696 Systehttp://m.Data.SQLite.dll
2023-06-11  오전 06:00           206,512 Systehttp://m.Data.SQLite.EF6.dll
2018-09-19  오전 04:38           143,408 Systehttp://m.Drawing.Common.dll
2019-11-15  오후 05:37            17,784 Systehttp://m.Security.Cryptography.ProtectedData.dll
2019-11-15  오후 05:56            92,536 Systehttp://m.Security.Permissions.dll
2019-11-15  오후 05:56            25,976 Systehttp://m.Windows.Extensions.dll
              22개 파일          12,332,664 바이트
               3개 디렉터리  17,472,704,512 바이트 남음

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\bin\Debug\net8.0>

//Usage DLL(Unlimited Version)
//Usage DLL(Unlimited Version)
//Usage DLL(Unlimited Version)
//Usage DLL(Unlimited Version)
//Usage DLL(Unlimited Version)
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\reference 디렉터리

2024-09-26  오전 08:14    

          .


2024-09-26  오전 08:14    

          ..


2011-06-17  오전 10:16           553,984 ServiceStack.dll
2011-06-17  오전 10:16            33,792 ServiceStack.Interfaces.dll
2011-06-17  오전 10:16            20,480 ServiceStack.ServiceInterface.dll
               3개 파일             608,256 바이트
               2개 디렉터리  17,472,036,864 바이트 남음

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\reference>

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\bin\Debug\net8.0\Data>copy "C:\Users\B210145_BK\Downloads\exture_4_3_ubuntu_ticker\multipleredistickerserver\Data\*.sql" .
C:\Users\B210145_BK\Downloads\exture_4_3_ubuntu_ticker\multipleredistickerserver\Data\CreateDb.sql
        1개 파일이 복사되었습니다.

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\bin\Debug\net8.0\Data>dir
 C 드라이브의 볼륨: B210145_BAK
 볼륨 일련 번호: 1C66-FEA7

 C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\bin\Debug\net8.0\Data 디렉터리

2024-09-26  오전 08:17    

          .


2024-09-26  오전 08:17    

          ..


2024-07-22  오후 07:20            15,686 CreateDb.sql
               1개 파일              15,686 바이트
               2개 디렉터리  17,472,454,656 바이트 남음

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\bin\Debug\net8.0\Data>

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\bin\Debug\net8.0>copy "C:\Users\B210145_BK\Downloads\exture_4_3_ubuntu_ticker\multipleredistickerserver\Ser*.xml" .
C:\Users\B210145_BK\Downloads\exture_4_3_ubuntu_ticker\multipleredistickerserver\ServerInfo.xml
        1개 파일이 복사되었습니다.

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\bin\Debug\net8.0>dir *.xml
 C 드라이브의 볼륨: B210145_BAK
 볼륨 일련 번호: 1C66-FEA7

 C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\bin\Debug\net8.0 디렉터리

2024-07-31  오후 06:45               475 ServerInfo.xml
               1개 파일                 475 바이트
               0개 디렉터리  17,471,488,000 바이트 남음

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\bin\Debug\net8.0>
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser>dotnet run
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj : warning NU1803: 'http://nuget.grapecity.com/nuget' 'HTTP' 원본을 사용하여 'restore' 작업 을 실행하고 있습
니다. 비 HTTPS 액세스는 이후 버전에서 제거됩니다. 'HTTPS' 원본으로 마이그레이션하는 것이 좋습니다.
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj : warning NU1803: 'http://nuget.grapecity.com/nuget' 'HTTP' 원본을 사용하여 'restore' 작업 을 실행하고 있습
니다. 비 HTTPS 액세스는 이후 버전에서 제거됩니다. 'HTTPS' 원본으로 마이그레이션하는 것이 좋습니다.
1. REDIS CONNECT
2. SQLite DATABASE CONNECT
Unhandled exception. System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\Data\CreateDB.sql'.
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at Systehttp://m.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
   at Systehttp://m.IO.StreamReader..ctor(String path)
   at mdiwebrowser.MdiResponseFrm.CreateDb() in C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\MdiResponseFrm.cs:line 358
   at mdiwebrowser.MdiResponseFrm.RUN() in C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\MdiResponseFrm.cs:line 62
   at mdiwebrowser.Program.Main() in C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\Program.cs:line 17

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser>

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser>mkdir Data

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser>cd Data

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\Data>copy "C:\Users\B210145_BK\Downloads\exture_4_3_ubuntu_ticker\multipleredistickerserver\Data\*.sql" .
C:\Users\B210145_BK\Downloads\exture_4_3_ubuntu_ticker\multipleredistickerserver\Data\CreateDb.sql
        1개 파일이 복사되었습니다.

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\Data>dir
 C 드라이브의 볼륨: B210145_BAK
 볼륨 일련 번호: 1C66-FEA7

 C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\Data 디렉터리

2024-09-26  오전 08:20    

          .


2024-09-26  오전 08:20    

          ..


2024-07-22  오후 07:20            15,686 CreateDb.sql
               1개 파일              15,686 바이트
               2개 디렉터리  17,485,975,552 바이트 남음

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\Data>
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser>dotnet run
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj : warning NU1803: 'http://nuget.grapecity.com/nuget' 'HTTP' 원본을 사용하여 'restore' 작업 을 실행하고 있습
니다. 비 HTTPS 액세스는 이후 버전에서 제거됩니다. 'HTTPS' 원본으로 마이그레이션하는 것이 좋습니다.
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj : warning NU1803: 'http://nuget.grapecity.com/nuget' 'HTTP' 원본을 사용하여 'restore' 작업 을 실행하고 있습
니다. 비 HTTPS 액세스는 이후 버전에서 제거됩니다. 'HTTPS' 원본으로 마이그레이션하는 것이 좋습니다.
1. REDIS CONNECT
2. SQLite DATABASE CONNECT
3. KRX(TCP) CONNECT SEREVR
--------------------------------------------------
HELP.DEBUG[E4.0].TAIL[E3.0]-----------------------
[2024-09-26 08:20:21]
[0001][A001S]:[00000]
[0002][A001Q]:[00000]
[0003][A002S]:[00000]
[0004][A003S]:[00000]
[0005][A004S]:[00000]
[0006][CA01S]:[00000]
[0007][CA01Q]:[00000]
[0008][IA000]:[00000]
[0009][B901S]:[00000]
[0010][A301S]:[00000]
[0011][B601S]:[00000]
[0012][C001S]:[00000]
[0013][C301S]:[00000]
[0014][R801S]:[00000]
[0015][B501S]:[00000]
[0016][M401S]:[00000]
[0017][A701S]:[00000]
[0018][B901Q]:[00000]
[0019][A301Q]:[00000]
[0020][B601Q]:[00000]
[0021][C001Q]:[00000]
[0022][C301Q]:[00000]
[0023][R801Q]:[00000]
[0024][B501Q]:[00000]
[0025][M401Q]:[00000]
[0026][A701Q]:[00000]
--------------------------------------------------

//SUCCES
//SUCCES
//SUCCES
//SUCCES


//EDIT run.cmd
//EDIT run.cmd
//EDIT run.cmd
//EDIT run.cmd

copy "C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\reference\*.DLL" "C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\bin\Debug\net8.0"
dotnet run

//FINAL
//FINAL
//FINAL



C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser>run.cmd

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser>copy "C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\reference\*.DLL" "C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\bin\Debug\net8.0"
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\reference\ServiceStack.dll
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\reference\ServiceStack.Interfaces.dll
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\reference\ServiceStack.ServiceInterface.dll
        3개 파일이 복사되었습니다.

C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser>dotnet run
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj : warning NU1803: 'http://nuget.grapecity.com/nuget' 'HTTP' 원본을 사용하여 'restore' 작업 을 실행하고 있습
니다. 비 HTTPS 액세스는 이후 버전에서 제거됩니다. 'HTTPS' 원본으로 마이그레이션하는 것이 좋습니다.
C:\Users\B210145_BK\Downloads\exture_4_5_ubuntu_ticker\mdiwebrowser\mdiwebrowser.csproj : warning NU1803: 'http://nuget.grapecity.com/nuget' 'HTTP' 원본을 사용하여 'restore' 작업 을 실행하고 있습
니다. 비 HTTPS 액세스는 이후 버전에서 제거됩니다. 'HTTPS' 원본으로 마이그레이션하는 것이 좋습니다.
1. REDIS CONNECT
2. SQLite DATABASE CONNECT
3. KRX(TCP) CONNECT SEREVR
--------------------------------------------------
HELP.DEBUG[E4.0].TAIL[E3.0]-----------------------
[2024-09-26 08:24:14]
[0001][A001S]:[00000]
[0002][A001Q]:[00000]
[0003][A002S]:[00000]
[0004][A003S]:[00000]
[0005][A004S]:[00000]
[0006][CA01S]:[00000]
[0007][CA01Q]:[00000]
[0008][IA000]:[00000]
[0009][B901S]:[00000]
[0010][A301S]:[00000]
[0011][B601S]:[00000]
[0012][C001S]:[00000]
[0013][C301S]:[00000]
[0014][R801S]:[00000]
[0015][B501S]:[00000]
[0016][M401S]:[00000]
[0017][A701S]:[00000]
[0018][B901Q]:[00000]
[0019][A301Q]:[00000]
[0020][B601Q]:[00000]
[0021][C001Q]:[00000]
[0022][C301Q]:[00000]
[0023][R801Q]:[00000]
[0024][B501Q]:[00000]
[0025][M401Q]:[00000]
[0026][A701Q]:[00000]
--------------------------------------------------

c# redisTicker.server 를 Windows/Linux에서 빌드및 실행

1. 소스는 동일하다.
2. 빌드및 실행방법의 명령어만 틀리다.

windows
msbuild - 
linux
dotnet build & dotnet run

C#에서 Redis에 접속하기 위해 사용할 수 있는 대표적인 패키지들은 다음과 같습니다:

1. StackExchange.Redis

가장 널리 사용되는 Redis 클라이언트 라이브러리입니다.
성능이 뛰어나고 기능이 풍부합니다.
비동기 작업과 연결 풀링을 지원합니다.
NuGet 패키지로 제공되며, 설치 명령어는 다음과 같습니다:

2. ServiceStack.Redis

Redis 클라이언트로 안정적인 성능을 제공합니다.
유료 라이선스가 필요할 수 있지만, 소규모 애플리케이션에서는 무료로 사용할 수 있습니다.
다양한 기능을 제공하며, 간단한 사용법을 가지고 있습니다.
NuGet 패키지로 제공되며, 설치 명령어는 다음과 같습니다:

3. CSRedis

간편한 API를 제공하는 라이브러리로, Redis의 기본적인 기능을 쉽게 사용할 수 있습니다.
StackExchange.Redis에 비해 더 간단한 구조를 가지고 있습니다.
NuGet 패키지로 제공되며, 설치 명령어는 다음과 같습니다:

일반적으로 StackExchange.Redis가 가장 많이 사용되며, 성능과 안정성 면에서 좋은 평가를 받고 있습니다.

예외발견

(Exception): The free-quota limit on '6000 Redis requests per hour' has been reached. Please see https://servicestack.net to upgrade to a commercial license or visit https://github.com/ServiceStackV3/ServiceStackV3 to revert back to the free ServiceStack v3.

증상
1. 서버에서 나타나는 예외로, Redis간 Request처리시에 한시간에 6000건이 넘으면 예외가 발생된다.
즉 DLL을 따로 구입해서 처리해야한다.

sinfo@sinfo:~/exture_3_0_ticker/mdiwebrowser/bin/Debug/net7.0$ ls -lrt Ser*
-rw------- 1 sinfo sinfo 553984 Sep 18 07:52 ServiceStack.dll
-rw------- 1 sinfo sinfo  33792 Sep 18 07:52 ServiceStack.Interfaces.dll
-rw------- 1 sinfo sinfo  20480 Sep 18 07:52 ServiceStack.ServiceInterface.dll
sinfo@sinfo:~/exture_3_0_ticker/mdiwebrowser/bin/Debug/net7.0$



해당 오류 메시지는 현재 사용 중인 ServiceStack의 무료 사용 한도를 초과했음을 나타냅니다. ServiceStack은 무료 사용과 상용 라이센스를 제공하며, 무료 사용에는 요청 수에 제한이 있습니다. 오류 메시지에서는 Redis 요청이 시간당 6000건의 무료 한도를 초과했음을 알리고 있습니다.

이 문제를 해결하기 위한 방법은 다음과 같습니다:

1. 상용 라이센스 구매

ServiceStack의 상용 라이센스를 구매하면 무료 사용 한도를 넘어서서 더 많은 요청을 처리할 수 있습니다. 라이센스 구입에 대한 정보는 ServiceStack 웹사이트에서 확인할 수 있습니다. 상용 라이센스를 구매하면 보다 높은 한도와 추가적인 기능을 제공받을 수 있습니다.

2. ServiceStack v3로 되돌리기

무료로 제공되는 ServiceStack v3는 최신 버전보다 기능이 제한적일 수 있지만, 무료 사용 한도는 더 넉넉할 수 있습니다. ServiceStack v3로 돌아가려면, ServiceStack GitHub 레포지토리에서 v3 버전을 다운로드하고 사용하세요.

ServiceStack v3로 변경하는 방법:

  1. 기존 패키지 제거: 현재 사용 중인 ServiceStack 패키지를 제거합니다.
  2.  
    코드 복사
    dotnet remove package ServiceStack
  3. bash
  4. ServiceStack v3 패키지 설치: v3 버전의 ServiceStack 패키지를 설치합니다. 이 패키지는 NuGet에서 찾을 수 있습니다. 패키지 버전이 맞는지 확인하고 설치합니다.
  5. bash
    코드 복사
    dotnet add package ServiceStack --version [v3.0.0] # 실제 v3 버전 번호로 대체
  6. 프로젝트 업데이트: 코드에서 ServiceStack API 사용 방식을 확인하고 v3 버전에 맞게 필요한 변경을 적용합니다.

3. Redis 요청 수 조절

Redis 요청 수를 줄이는 방법을 고려해볼 수 있습니다. 캐싱 전략을 개선하거나 불필요한 요청을 줄이는 방법으로 Redis 요청 수를 조절할 수 있습니다.

몇 가지 조언:

  • 캐시 전략 최적화: 캐시 만료 시간, 캐시 키 관리 등을 조정하여 Redis 요청을 줄일 수 있습니다.
  • 데이터 전송 최적화: 필요 없는 데이터 전송을 줄이고 필요한 데이터만 요청하도록 최적화합니다.

4. Alternative Caching Solutions

Redis 외에도 다양한 캐싱 솔루션이 있습니다. 필요에 따라 다른 캐싱 솔루션을 검토하고 적용할 수 있습니다. 예를 들어, 메모리 기반 캐시 또는 파일 시스템 기반 캐시를 사용할 수 있습니다.

요약

  • 상용 라이센스 구매 또는
  • ServiceStack v3로 버전 다운그레이드 또는
  • Redis 요청 수를 줄이는 전략 적용

이 방법들 중에서 상황에 맞는 해결책을 선택하여 문제를 해결할 수 있습니다.

C#에서 클래스를 생성할 때 new 키워드(먼저 코드 훑어보기)


C#에서 클래스를 생성할 때 new 키워드를 사용하는 것은 객체 지향 프로그래밍의 기본적인 개념과 관련이 있습니다. 하지만 언어학적인 측면에서 C#의 이러한 특징은 몇 가지 중요한 이유와 관련이 있습니다:

  1. 명시적 객체 생성: new 키워드를 사용함으로써 객체를 명시적으로 생성하는 방식은 C#에서 객체 지향 프로그래밍의 기본 원칙 중 하나인 명확성과 직관성을 제공합니다. 이는 객체가 생성되고 메모리가 할당되는 순간을 코드에서 분명히 나타내어, 객체의 생명 주기를 명확히 관리할 수 있게 합니다.
  2. 메모리 관리: C#은 가비지 컬렉션(Garbage Collection)을 사용하는 언어입니다. new 키워드를 사용하여 객체를 생성하면, 해당 객체는 힙(Heap) 메모리에 할당되며, 가비지 컬렉터가 이를 관리합니다. 이는 메모리 누수 방지와 효율적인 메모리 관리를 가능하게 합니다.
  3. 형식 안정성: C#은 강타입 언어로, 변수의 형식이 엄격히 검증됩니다. new 키워드를 사용함으로써, 컴파일 타임에 타입의 정확성을 보장받을 수 있습니다. 이는 형식 안전성을 유지하고, 코드의 버그를 사전에 방지하는 데 도움을 줍니다.
  4. 생성자 호출: new 키워드를 사용하면 클래스의 생성자가 호출됩니다. 생성자는 객체의 초기 상태를 설정하는 역할을 하며, 이는 객체를 사용할 준비가 되었다는 것을 보장합니다. 생성자의 호출은 클래스의 초기화와 관련된 중요한 언어적 특성입니다.
  5. 명시적 인스턴스화: new 키워드를 사용하여 객체를 생성하는 방식은 클래스의 인스턴스화가 명시적임을 의미합니다. 이는 코드에서 객체가 언제, 어떻게 생성되는지를 명확히 이해할 수 있게 도와줍니다.
  6. 객체 지향 패러다임: C#은 객체 지향 프로그래밍(OOP)을 기반으로 한 언어입니다. new 키워드는 OOP의 기본 원칙을 따르며, 객체 지향 설계에서 중요한 역할을 하는 객체 생성과 초기화 과정을 관리하는 방식으로, 언어의 구조와 설계 철학을 반영합니다.

따라서, C#에서 new 키워드를 사용하여 클래스를 생성하는 것은 단순히 메모리 할당의 수단이 아니라, 언어의 구조와 객체 지향 패러다임, 메모리 관리, 형식 안정성 등 여러 언어적 특징과 관련이 있습니다.


추가)
C#에서 new 선언 없이 객체를 사용하지 못하는 이유는 메모리 할당초기화와 관련이 있습니다. 객체는 힙(heap) 메모리에 할당되어야 하고, 이를 위해서는 new 키워드가 필요합니다. 다음은 그 이유를 설명한 몇 가지 핵심 사항입니다:

  1. 객체의 메모리 할당: C#에서 클래스는 참조형(reference type)입니다. 클래스의 인스턴스를 생성할 때는 메모리 공간을 할당해야 하며, 이를 위해 new 키워드를 사용하여 객체를 힙 메모리에 할당합니다. new를 사용하지 않으면 C# 컴파일러는 객체가 메모리에 할당되지 않았다고 판단하여 사용할 수 없다고 경고합니다.
  2. 생성자 호출: 객체를 만들 때 new 키워드는 생성자를 호출하여 객체를 올바르게 초기화합니다. 생성자가 호출되지 않으면 객체의 내부 상태가 초기화되지 않은 상태로 남아있게 되어 프로그램에서 예기치 않은 오류가 발생할 수 있습니다.
  3. 널 참조 예외(NullReferenceException): new를 사용하지 않고 객체를 선언한 경우, 그 객체는 null 상태입니다. 이 상태에서 해당 객체의 멤버에 접근하려고 하면 NullReferenceException이 발생할 수 있습니다. new 키워드를 통해 객체를 명시적으로 생성하지 않으면 객체가 가리키는 유효한 메모리가 없기 때문입니다.
public static CodeLengthInfo findCodeArrayIndexInfo(string code)
{
    CodeLengthInfo info = new CodeLengthInfo();
    List<string> strList = new List<string>();

    for(int kk=0; kk<krxdetailformat.GetLength(0); kk++)
    {
        if(krxdetailformat[kk,0] == code)
        {
            strList.Add(krxdetailformat[kk,9]);
        }
    }
    
    int arraysum = 0;
    info.arrayIndex = new int[strList.Count];

    for(int kk=0; kk<strList.Count; kk++)
    {
        arraysum = arraysum + Convert.ToInt32(strList[kk]);
info.arrayIndex[kk] = Convert.ToInt32(strList[kk]);

    }
    info.arraysum = arraysum;
    info.code = code;

    return info;
}
public struct CodeLengthInfo
{
        public string code;
        public int arraysum;
        public int[] arrayIndex;
}

 

메소드에 static 키워드를 사용하는 이유는 여러 가지가 있습니다. static 메소드는 클래스의 인스턴스(즉, 객체)를 생성하지 않고도 호출할 수 있는 메소드입니다. 아래는 static 메소드를 사용하는 주요 이유들입니다:

  1. 인스턴스와 무관한 기능: static 메소드는 클래스의 인스턴스 상태에 의존하지 않고, 클래스 자체의 상태에만 의존합니다. 위의 findCodeArrayIndexInfo 메소드는 특정 코드에 대한 정보를 찾는 기능을 수행하고 있으며, 이 메소드는 클래스의 인스턴스 상태에 의존하지 않기 때문에 static으로 선언되었습니다. 이는 메소드가 클래스 레벨에서 독립적으로 동작할 수 있음을 의미합니다.
  2. 메모리 절약: static 메소드는 클래스가 메모리에 로드될 때 한 번만 생성되며, 클래스의 모든 인스턴스가 이 메소드를 공유합니다. 이는 메모리 사용을 최적화하는 데 도움이 됩니다. 인스턴스 메소드는 각 객체마다 별도로 존재하지만, static 메소드는 클래스당 하나만 존재합니다.
  3. 유틸리티 메소드: static 메소드는 일반적으로 유틸리티 메소드로 사용됩니다. 유틸리티 메소드는 주로 데이터 변환, 계산 또는 기타 공통 작업을 수행하며, 클래스의 특정 상태나 인스턴스 변수에 접근할 필요가 없습니다. findCodeArrayIndexInfo 메소드도 이러한 유틸리티 메소드의 예로 볼 수 있습니다.
  4. 편리한 접근: static 메소드는 클래스 이름을 통해 직접 호출할 수 있으므로, 객체를 생성하지 않고도 메소드에 접근할 수 있습니다. 예를 들어, MyClass.findCodeArrayIndexInfo(code)처럼 호출할 수 있습니다. 이는 간편하게 메소드를 사용할 수 있는 방법을 제공합니다.
  5. 성능: static 메소드는 객체 생성 비용을 줄이고, 직접 호출할 수 있기 때문에 성능 측면에서 유리할 수 있습니다. 객체를 생성하지 않고도 메소드를 호출할 수 있으므로, 특정 상황에서는 성능 향상을 가져올 수 있습니다.

따라서 findCodeArrayIndexInfo 메소드가 static으로 정의된 이유는 해당 메소드가 특정 인스턴스 상태에 의존하지 않고, 클래스 수준에서 독립적으로 동작하기 때문입니다.

 

+ Recent posts