
IOCP, Boost.Asio, epoll 예제1. IOCP (Windows)플랫폼: Windows설명: IOCP는 Windows에서 제공하는 비동기 I/O 처리 메커니즘으로, 고성능 네트워크 서버를 구축할 때 사용됩니다.예제 코드:#include #include #include #include #include #pragma comment(lib, "Ws2_32.lib")struct ClientContext { OVERLAPPED overlapped; SOCKET socket; char buffer[1024];};void workerThread(HANDLE iocpHandle) { DWORD bytesTransferred; ULONG_PTR completionKey; LP..

IOCP, Boost.Asio, epoll 비교 1. IOCP (I/O Completion Port) 플랫폼: Windows 설명: Microsoft에서 제공하는 고성능 비동기 I/O 처리 기술로, 소켓, 파일, 파이프 등을 효율적으로 처리합니다. 주요 특징: 완료 기반 이벤트 모델 (비동기 작업 완료 시만 처리). 스레드 풀을 활용한 효율적인 CPU 사용. 수십만 개의 동시 연결을 처리할 수 있는 고성능. 2. Boost.Asio 플랫폼: 크로스 플랫폼 (Windows, Linux, macOS) 설명: Boost 라이브러리의 일부로, 고성능 비동기 I/O를 제공하며, 플랫폼별 메커니즘(IOCP, epoll 등)을 ..

ACE 라이브러리 설명ACE(The Adaptive Communication Environment)는 네트워크 및 분산 시스템 개발을 지원하기 위한 C++ 기반의 오픈소스 라이브러리입니다. 네트워크 소켓, 멀티스레드, 동기화 제어 등의 기능을 제공합니다.주요 특징이식성: 다양한 플랫폼에서 동작.높은 성능: 멀티스레드 및 이벤트 기반 프로그래밍 지원.모듈화된 디자인: 필요한 기능만 선택적으로 사용 가능.클라이언트-서버 통신 C++ 예제 코드서버 코드// 서버 코드 (server.cpp)#include #include #include #include #include int main() { ACE_INET_Addr port(8080); ACE_SOCK_Acceptor acceptor; if (..

Get Public IP in C++This code uses libcurl to retrieve the public IP address by making an HTTP request to http://api.ipify.org.#include #include #include size_t WriteCallback(void* contents, size_t size, size_t nmemb, std::string* userp) { userp->append((char*)contents, size * nmemb); return size * nmemb;}std::string GetPublicIP() { CURL* curl; CURLcode res; std::string readBuffer..

GetMyIPs C++ CodeThis code retrieves the IP addresses of the system's network interfaces on both Windows and Linux platforms using C++14.#include #include #include // Platform-specific includes#ifdef _WIN32#include #include #pragma comment(lib, "ws2_32.lib")#else#include #include #include #include #include #endifstd::vector GetMyIPs() { std::vector ipAddresses;#ifdef _WIN32 // Initialize W..

INI 파일을 읽고 데이터에 접근할 수 있는 간단한 클래스를 구현하려면, 표준 라이브러리만 사용하여 파일을 파싱하는 로직을 작성할 수 있습니다. 다음은 기본적인 INI 파일 형식을 읽고 데이터에 접근할 수 있는 C++ 클래스의 예제입니다.주요 특징파일 읽기:파일을 줄 단위로 읽으며 섹션, 키, 값을 파싱합니다.공백 및 주석 처리:공백을 제거하고 ; 또는 #로 시작하는 주석을 무시합니다.데이터 저장:섹션(std::string)과 키(std::string)를 기반으로 값을 저장합니다.오류 처리:없는 섹션이나 키에 접근하려고 할 때 예외를 던집니다.간단한 API:섹션 또는 키 값을 손쉽게 가져올 수 있습니다.#include #include #include #include #include class IniPar..
- Total
- Today
- Yesterday
- 스쿠버다이빙
- 서귀포블루버블
- C++
- 리눅스
- 울릉도
- 현포다이브
- 서귀포
- ReFS
- ip
- 블루버블
- CMake
- Windows
- PowerShell
- 블루버블다이브팀
- DLL
- Thread
- C
- 디자인패턴
- 패턴
- 암호화
- Build
- Linux
- C#
- C# 고급 기술
- C#.NET
- 제주도
- 윈도우
- 성산블루버블
- OpenSource
- 블루버블다이빙팀
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |