All, winter comes, plz keep warm and keep healthy. During the meditation about the work, I got some question about the function of fd dup2 . I create a socket server, and a client. the server send, the client receive data. But Now I want to dup2 the server socket fd to a file df in order to let the client read data directly from a file located in server. I write like
while(socketdf = accept(...)) { dup2(filefd , socketfd); }
However, it doesnot work is this possible? Can you give me any advice on this? Thanx