Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while(1){
- memcpy(buf, "i am server", BUFLEN);
- if (send(clisockfd, buf, BUFLEN, 0) < 0){
- close(clisockfd);
- perror("send");
- break;
- }
- if (recv(clisockfd, buf, BUFLEN, 0) < 0){
- close(clisockfd);
- perror("recv");
- break;
- }
- printf("received: %s\n", buf);
- }
- while(1){
- printf("im done!");
- sleep(1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement