I'm programming a remote shell using the protocol UDP.
Therefore a server (server_udp.c) to listen one port number, and a client (client_udp.c) which send the command to the server, get the result of command and display it in the client screen.
The communication is already work but the my problem concerns the redirection of the standard output (1) in a file descriptor:
// server_udp.c
if(dup2(fd,1)<0){
perror("Error dup2"); exit(1);
}
if(read(fd,buf_response,1024)<0) {
perror("Error dup2"); exit(1);
}
puts(buf_response);
And it displays nothing. The string "buf_response" is empty.
I think that you'd understand and can help me.
Thanks
