comparison seobeo/os/s_linux_edge.c @ 17:d97ec3ded2ae

[Seobeo] Few changes... - Fixed seobeo edge for macos - Updated so that socket creation can be used for both client and server - Started on a cutelient library for making connection to the server.
author June Park <parkjune1995@gmail.com>
date Sat, 04 Oct 2025 07:53:12 -0700
parents fb2cff495a60
children fa2b8af609d9
comparison
equal deleted inserted replaced
16:fb2cff495a60 17:d97ec3ded2ae
37 int thread_count, 37 int thread_count,
38 Dowa_PHashMap p_html_cache) 38 Dowa_PHashMap p_html_cache)
39 { 39 {
40 int epfd = epoll_create1(0); 40 int epfd = epoll_create1(0);
41 struct epoll_event ev = { 41 struct epoll_event ev = {
42 .events = EPOLLIN, 42 .events = EPOLLIN | EPOLLONESHOT,
43 .data.ptr = p_server_handle 43 .data.ptr = p_server_handle
44 }; 44 };
45 epoll_ctl(epfd, EPOLL_CTL_ADD, 45 epoll_ctl(epfd, EPOLL_CTL_ADD,
46 p_server_handle->socket, &ev); 46 p_server_handle->socket, &ev);
47 47
48 pthread_attr_t attr; 48 pthread_attr_t attr;
49 pthread_attr_init(&attr); 49 pthread_attr_init(&attr);
50 pthread_attr_setstacksize(&attr, 100 * 1024 * 1024); // 100 MB 50 pthread_attr_setstacksize(&attr, 100 * 1024 * 1024); // 100 MB
51 51
52 pthread_t threads[thread_count]; 52 pthread_t threads[thread_count];
53 WorkerArgs args = { p_server_handle, p_html_cache, epfd };
54 for (int i = 0; i < thread_count; i++) 53 for (int i = 0; i < thread_count; i++)
55 { 54 {
55 WorkerArgs args = { p_server_handle, p_html_cache, epfd };
56 pthread_create(&threads[i], NULL, 56 pthread_create(&threads[i], NULL,
57 Seobeo_Web_Edge_Worker, &args); 57 Seobeo_Web_Edge_Worker, &args);
58 } 58 }
59 for (int i = 0; i < thread_count; i++) 59 for (int i = 0; i < thread_count; i++)
60 { 60 {