functionality of Socket>>socketError

Ned Konz ned at squeakland.org
Sun Aug 29 15:18:31 UTC 2004


On Sunday 29 August 2004 6:43 am, David T. Lewis wrote:
> > Why not have the primitives return a symbol which is a POSIX error name?
> > We have a list of codes that can be returned from the Socket primitives
> > and each platform VM is coded to that standard. Then you don't need to
> > know what error code on each platform is, the code in the Squeak side is
> > standard and you don't need a platform mapping class.
> > Plus people who know POSIX stuff :) can at least make some sense of what
> > is going wrong.
>
> But yes, I agree that your suggestion here might be a simpler approach for
> reporting socket errors. (I'm no expert on POSIX sockets, so I don't know
> if this is workable across a range of platforms.)

That doesn't fix the problem that you get when your primitive calls several 
API calls, each of which can return roughly the same set of errors.

In cases like that you'd either have to:
* pass back the *first* error code and let people guess what it meant (i.e. 
what API call generated it), or
* generate a new error code that names a particular error condition
* include more context (like for instance what the API call was that generated 
the error)

-- 
Ned Konz
http://bike-nomad.com/squeak/



More information about the Squeak-dev mailing list