Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!gatech!ulysses!smb From: smb@ulysses.homer.nj.att.com (Steven M. Bellovin) Newsgroups: comp.unix.wizards Subject: Re: My problem with fdopen and sockets........ Message-ID: <11238@ulysses.homer.nj.att.com> Date: 19 Feb 89 15:42:40 GMT References: <7937@netnews.upenn.edu> <9556@cit-vax.Caltech.Edu> Distribution: na Organization: AT&T Bell Laboratories, Murray Hill Lines: 11 In article <9556@cit-vax.Caltech.Edu>, wen-king@cit-vax.Caltech.Edu (King Su) writes: } Secondly, you do not need two sockets, you just need two FILEs. You can } apply fdopen on the same file twice. You don't need to dup it either. } For example: } } in = fdopen(soc,"r"); } out = fdopen(soc,"w"); That is not correct for System V; you do indeed need to do the dup(). Please note that I'm speaking empirically... (i.e., it broke on me the other way.)