[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
fork() and socketpair()
- To: linuxgames@sunsite.dk
- Subject: fork() and socketpair()
- From: Francesco Orsenigo <xarvh@lombardiacom.it>
- Date: Sun, 24 Mar 2002 13:20:54 +0100
- Delivered-To: archiver@seul.org
- Delivered-To: mailing list linuxgames@sunsite.dk
- Delivery-Date: Sun, 24 Mar 2002 07:24:43 -0500
- Mailing-List: contact linuxgames-help@sunsite.dk; run by ezmlm
- Organization: Xarvh Project
- Reply-To: linuxgames@sunsite.dk
My program forks into two separate processes, and i must connect them with a
pipe wich i must be able to use with send() and recv().
socketpair is perfect (i socketpair() and then fork()) but it seems not very
portable.
The alternative would be fork() and then link the two processes with standard
socket()/connect()/listen() calls.
I thought about using pipe(), but it is not full-duplex and i don't know if
it is safe to use with send() and recv().
Thanx,
Francesco Orsenigo,
Xarvh Projext
http://freeweb.lombardiacom.it/xarvh/