Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement