#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <arpa/inet.h>
#include <string.h>

int main(){
    int sck = socket(PF_INET, SOCK_STREAM, 0);
    struct sockaddr_in srv;
    memset(&srv, 0, sizeof(srv));
    srv.sin_family = AF_INET;
    srv.sin_port = htons(5489);
    srv.sin_addr.s_addr = htonl(INADDR_ANY);
    if(bind(sck, &srv, sizeof(srv))){
        printf("Sheisee!!");    
    }
    
    if(listen(sck,5)){
        printf("They killed Kenny");
    }
    
    while(1){
       int socket = accept(sck, NULL, NULL);
       char* message = "Linux programmers like Bill Gates, they cant acknowledge existence of users using other systems either. Too bad they aren't majority";
       if(fork()==0){
       write(socket, message, strlen(message));
       close(socket);
       exit(0);
       }else{
         close(socket);
       }        
    }     
}
