SHARE
TWEET

Untitled

a guest Sep 13th, 2017 40 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int sendToRandom(int sock){
  2.  
  3.     int portno=4242;
  4.     struct sockaddr_in serv_addr;
  5.     struct hostent *server;
  6.  
  7.     serv_addr.sin_family = AF_INET;
  8.     serv_addr.sin_port = htons(portno);
  9.     serv_addr.sin_addr.s_addr = inet_addr("81.170.143.231");
  10.     memset(&(serv_addr.sin_zero), 0, 8);
  11.  
  12.  
  13.     if (connect(sock,(struct sockaddr *) &serv_addr,sizeof(serv_addr)) < 0){
  14.         perror("ERROR connecting");
  15.         exit(1);
  16.     } else {
  17.         printf("Random person sent away!!");
  18.     }
  19.  
  20. }
RAW Paste Data
Top