hello, I have read the rpc-from-scratch blog.It help me a lot to understand how rcp works. but when I compile the code then execute, I find whatever number I give to the client, the client always report is prime.
I change the int buf[1] to char buf[1], it works well.
// Now, wait to receive the answer.
int buf[1]; // Just receiving a single byte back that represents a boolean. ---> char buf[1]
int bytes_received = recv(sockfd, &buf, 1, 0);
if (bytes_received == -1) {
perror("recv");
exit(1);
}
hello, I have read the rpc-from-scratch blog.It help me a lot to understand how rcp works. but when I compile the code then execute, I find whatever number I give to the client, the client always report is prime.
I change the
int buf[1] to char buf[1], it works well.