*BSD News Article 19403


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!howland.reston.ans.net!vixen.cso.uiuc.edu!moe.ksu.ksu.edu!cis.ksu.edu!vijay
From: vijay@cis.ksu.edu (Vijay.K.Mandava)
Newsgroups: comp.unix.bsd
Subject: socketpairs
Date: 12 Aug 93 02:29:13 GMT
Organization: Kansas State University
Lines: 19
Message-ID: <vijay.745123092@depot.cis.ksu.edu.cis.ksu.edu>
NNTP-Posting-Host: depot.cis.ksu.edu
Summary: which process gets which socket?
Keywords: fork, socketpair

 Hi there,
     
      if we create a socketpair, and then fork, i  realize that new
      sockets are returrned in sv[0] and sv[1]. but i assume that for a
      pipe or a single socket, fd[0] is used for reading and fd[1] is
      used for writing. i assume that same end is used for reading and
      writing by both parent and child in a socket pair. But in the Sun
      OS manual, (Network Programming) sv[0] is used for both reading
      and writing by the parent, and sv[1] is used for both reading and
      writingby the parent.
	 How is this possible?

	 Please mail to my account.


	 Thanks in advance,
	 vijay@cis.ksu.edu
-- 
  Feels Good Remembering You