>>>>> "LW" == Larry Wall <[EMAIL PROTECTED]> writes:

  LW>      multi sub opensocket (
  LW>                   Str +$mode = 'rw',
  LW>                   Str +$encoding = 'auto',
  LW>                   Str [EMAIL PROTECTED]) returns IO;

and how will that support async (non-blocking) connects? or listen
sockets? i assume this is sorta the replacement for IO::Socket which is
a pure key/value api (except for the shortcut single arg host:port
which is nice to also support). for async you need to provide a callback
in the signature (beyond all the other socket args), an optional timeout
(with its own callback). the callbacks could be defaulted to subs in the
current module/namespace but the coder may also want an OO callback
which needs an object and method. another little optional argument is a
private data field. sure an object callback could handle on a per object
basis. but what if one object wanted to manage multiple async socket
connections? each one needs to be identified in the callbacks which is
what the private data is for. it is passed as an arg to the callback

  LW> We should probably reserve io() for the overdwim and sysopen() for the
  LW> underdwim, and then not sweat the middle so much.  :-)

then io would be common blocking connects (which is what most socket
connections are) and sysopen is for sockets????. why not just support
the standard socket subs as in perl5? they could be in a module but they
are just simple wrappers around the system calls. 

i would prefer if opensocket's signature were fully fleshed out with
named args (with some defaults). just passing in an extra list is a poor
api as there are so many socket options. just read PBP (when it comes
out) for damian's take on long arg lists. :)


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

Reply via email to