Problem with Socket under Linux...

Andreas Raab Andreas.Raab at gmx.de
Wed Apr 24 09:45:29 UTC 2002


Göran,

> (Andreas, you must be in Germany right? Normally the list is 
> pretty dead when I am awake... :-))

You're right ;-)

> > > Then... you do not in fact signal the semaphore when there is 
> > > no data - right? (I don't really know what your last line before
> > > "return 0" does, is that the "arming" stuff? Hey, btw, the Unix
> > > version returns -1 if the socket is not valid, not 0...)
> > 
> > Which is right. It means that the socket is broke, thus returning an
> > error code (-1) instead of telling the client that there's simply no
> > data available is the right thing to do.
> 
> Good.

Bad ... I just looked at the plugin side of it and it turns out that the
code for receiveDataAvailable _cannot_ return an error code. The return
code is converted into a boolean and any non-zero return value will be
interpreted as "true". There ya go. Gotta check my own code now.

Cheers,
  - Andreas




More information about the Squeak-dev mailing list