[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fork() and socketpair()



Joerg Seebohn:

> I do not know what portability consideration you have in mind,
> but under Linux a call to socketpair is perfect:
>    int  sv[2] ;
>    int  r = socketpair( PF_UNIX, SOCK_STREAM, AF_LOCAL, sv) ;

Yes, i called socketpair with the wrong arguments, now it works.
I was using "socketpair(AF_INET, SOCK_STREAM, 0, sd)".

Is possible to use PF_UNIX under other environments?
(Thank you, you've got me out of a trouble!)



Reply to Steve Baker:
> Pipes and sockets are entirely different mechanisms - pipes use file-system
> calls (hence read/write) and sockets use network-system calls (hence
> send/recv).

I need to use send()/recv(), to work on sockets with the same functions.





Thank you all,
Francesco Orsenigo
Xarvh Project - http://freeweb.lombardiacom.it/xarvh/