리눅스 C/C++ 리액터 패턴 기반 네트워크 I/O 처리
서버 측 네트워크 I/O 관리를 위한 리액터 패턴의 핵심 절차는 다음과 같습니다:
- 콜백 함수 정의 및 I/O 작업 핸들러 구현
typedef int(*HandlerFunc)(int fd);
int accept_handler(int fd);
int send_handler(int fd);
int recv_handler(int fd);
- 파일 디스크립터 관리 구조체 설계
struct connection {
int fd;
char recv_buf[BUF_SIZE];
int recv_le ...
8월 4일 03:54에 게시됨