📄 server.c
字号:
#include <stdio.h>#include <sys/stat.h>#include <sys/types.h>#include <string.h>#include <stdlib.h>#include <time.h>#include <pthread.h>#include "service.h"#include "s_io.h"int main_test(int fd){ char buf[] = "hello, world!\n"; write(fd, buf, sizeof(buf)); close(fd); return 0;}int main(){ struct server_info ser_info; struct handler_info han_info; ser_info.type = I_NET; ser_info.port = 1231; //ser_info.type = U_DOMAIN; //strcpy(ser_info.path, "/var/eyou/mfs.sock"); ser_info.thread_num = 32; ser_info.max_service = 2048; han_info.main_handler = main_test; han_info.init_handler = NULL; han_info.exit_handler = NULL; start_server(&ser_info, &han_info); return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -