Go to the FreeLists Home Page Home Signup Help Login
 



[openbeosnetteam] || [Date Prev] [09-2005 Date Index] [Date Next] || [Thread Prev] [09-2005 Thread Index] [Thread Next]

[openbeosnetteam] Re: socketpair() implementation

  • From: "info@xxxxxxxxxxxxxx" <info@xxxxxxxxxxxxxx>
  • To: openbeosnetteam@xxxxxxxxxxxxx
  • Date: Thu, 22 Sep 2005 10:48:28 -0500
I know what it means, what I want is an example of why you would use it. What's the purpose of "creating a pair of connected sockets".


Jérôme Duval wrote:
From http://www.opengroup.org/onlinepubs/009695399/functions/socketpair.html

"create a pair of connected sockets"

Note the word connected, it is important.
Though I don't know what means exactly "unbound pair" ...

Bye,
Jérôme

Selon "info@xxxxxxxxxxxxxx" <info@xxxxxxxxxxxxxx>:


Can anybody tell me why someone would use socketpair instead of just
creating two sockets?  I can't think of a reason to use it.

Philippe Houdoin wrote:

Hi Jerome and teammates ;-)



Please have a look at http://www.haiku-os.org/bugzilla/show_bug.cgi?id=52

to

give feedback or comments. socketpair() isn't on BeOS, but it's kind of
expected to be here IMO.


Well, as it's missing for POSIX 1003.1 compliance, I guess supporting it

will be

great. Not mandatory for R1, thought, but it's not like it's that hard to
implement.



I added a socketpair() prototype in our header sys/socket.h.


I saw this, yes.



My opinion about implementation would be to have a socketpair() in
src/kits/network/libsocket/socket.c which does (for AF_INET at least):
- calls socket() twice to have two sockets.
- call a new ioctl to have the network stack do the socketpair hard job :
bind(), listen(), connect(), accept()
- close the listening socket.


Sounds good to me, indeed.
BTW, these sockets are supposed to be unbounded.



As I never tested the Haiku network part, maybe I'm not the right person to
code this.


Then just implement a noop socketpair() in socket.c (both in libsocket and

in

libnet variant) and I'll self assign the task to implement it later.

I don't consider this as urgent as reaching beta stage of OpenGL Kit and

the

network stack missing features: DHCP, 802.11 support.
Maybe that's because I never used socketpair() so far ;-)

- Philippe















[ Home | Signup | Help | Login | Archives | Lists ]

All trademarks and copyrights within the FreeLists archives are owned by their respective owners.
Everything else ©2007 Avenir Technologies, LLC.