Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int receive_and_send(int connfd1, int connfd2)
- {
- char buf[BUFLEN];
- int bytes_send;
- int bytes_remaining;
- int bytes_received = 0;
- // TODO 6: Receptionati un mesaj de la connfd1
- bytes_received = recv(connfd1, buf, BUFLEN, 0);
- if (bytes_received != 0) {
- fprintf(stderr, "Received: %s", buf);
- }
- bytes_remaining = bytes_received;
- // TODO 7: Timiteti mesajul la connfd2
- send(connfd2, buf, bytes_remaining, 0);
- return bytes_received;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement