ddos/server.c
changeset 68 d549894aa6a9
parent 10 f19f44e2e863
child 77 49e0babccb23
equal deleted inserted replaced
67:abe63a276a36 68:d549894aa6a9
    11 #include <netinet/in.h>
    11 #include <netinet/in.h>
    12 #include <arpa/inet.h>
    12 #include <arpa/inet.h>
    13 #include <sys/types.h>
    13 #include <sys/types.h>
    14 #include <signal.h>
    14 #include <signal.h>
    15 
    15 
    16 int set_limit (int);
    16 int set_proc_limit (int);
    17 
    17 
    18 int main (int argc, char **argv)
    18 int main (int argc, char **argv)
    19 {
    19 {
    20     char message[81];
    20     char message[81];
    21     int server_socket;
    21     int server_socket;
    59     /*
    59     /*
    60      * Child quits immediately, father mustn't wait
    60      * Child quits immediately, father mustn't wait
    61      */
    61      */
    62     signal (SIGCHLD, SIG_IGN);
    62     signal (SIGCHLD, SIG_IGN);
    63 
    63 
    64     if (set_limit (500) != 0) {
    64     if (set_proc_limit (200) != 0) {
    65         printf ("Cannot limit the process limit\n");
    65         printf ("Cannot limit the process limit\n");
    66         return EXIT_FAILURE;
    66         return EXIT_FAILURE;
    67     }
    67     }
    68 
    68 
    69     for (;;) {
    69     for (;;) {