这个就不多说了,各种模型的一种综合应用,最终目的就是尽一切手段去压榨服务器资源,完整代码戳这里
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <signal.h>
#include <unistd.h>
#include <sys/types.h> /* See NOTES */
#include <sys/wait.h>
#include <sys/socket.h>
#include <sys/epoll.h>
#include <netinet/in.h>
#include <netinet/ip.h> /* superset of previous */
#include <arpa/inet.h>
#include "public_head.h"
#define LISTEN_BACKLOG 50
#define MAX_PROGRESS 1
#define MAX_EVENTS 5
static void grim_reaper(int sig)
{
int saved_error = errno;
while (waitpid(-1, NULL, WNOHANG) >