IO::Socket->socketpair()

IO::Socket->socketpair()

am 21.05.2007 21:25:05 von xhoster

In the spirit of DWIM, shouldn't IO::Select->socketpair()
provide reasonable defaults for DOMAIN, TYPE, and PROTOCOL if it is
called with no arguments?

It seems like the vast majority of the time I see socketpair used,
it is with (AF_UNIX, SOCK_STREAM, PF_UNSPEC). Indeed, until recently I
didn't even know what they meant, it was just copy and paste by rote--which
I think makes them excellent candidates for being DWIMed away.

Thanks for any thoughts,

Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB

Re: IO::Socket->socketpair()

am 21.05.2007 22:13:33 von Uri Guttman

>>>>> "x" == xhoster writes:

x> In the spirit of DWIM, shouldn't IO::Select->socketpair()
x> provide reasonable defaults for DOMAIN, TYPE, and PROTOCOL if it is
x> called with no arguments?

x> It seems like the vast majority of the time I see socketpair used,
x> it is with (AF_UNIX, SOCK_STREAM, PF_UNSPEC). Indeed, until recently I
x> didn't even know what they meant, it was just copy and paste by rote--which
x> I think makes them excellent candidates for being DWIMed away.

use pipe() instead as they are the same thing underneath these days in
at least unix flavors. $DEITY know what redmond does there.

uri

--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org