SHARE
TWEET

Untitled

a guest Jan 24th, 2020 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   while(1){
  2.     memcpy(buf, "i am server", BUFLEN);
  3.     if (send(clisockfd, buf, BUFLEN, 0) < 0){
  4.       close(clisockfd);
  5.       perror("send");
  6.       break;
  7.     }
  8.     if (recv(clisockfd, buf, BUFLEN, 0) < 0){
  9.       close(clisockfd);
  10.       perror("recv");
  11.       break;
  12.     }
  13.     printf("received: %s\n", buf);
  14.   }
  15.   while(1){
  16.     printf("im done!");
  17.     sleep(1);
  18.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top