arup@grad1.cis.upenn.edu (Arup Mukherjee) (02/13/89)
To all net.wizards : How does one convert an integer file descriptor to a FILE * file pointer in the case where the fd describes a socket, and you want to use the socket for *two-way* communication? The man page for fdopen() says that it will perform this convertion for file descriptors obtained from open(), dup(), creat() or pipe() - It says nothing about the case when the fd came from socket(). I tried to use it anyway - it works fine if you keep the flow of information one way...but any attempts at two-way communication fail miserably. I have tried using "r+" mode from fdopen(), as well as dup()'ing the file descriptor and then calling fdopen with "r" for one and "w" for the other. Neither method works. Any help would be greatly appreciated.... -Arup Mukherjee [arup@grasp.cis.upenn.edu] P.S. I am using internet (AF_INET) sockets of type SOCK_STREAM. We are running Ultrix 3.0.