Problem with Socket under Linux...

Andreas Raab Andreas.Raab at gmx.de
Tue Apr 23 10:11:23 UTC 2002


Göran,

> 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.

> The thing I don't understand with the Unix version is why we 
> signal the readSemaphore (well, it's not an immediate signal,
> it's a pending event - the semaphore will be signaled on the next
> call to notify() - how/when that call is done I don't know but
> since the semaphore does indeed get
> signalled AFAICT it must have been called somehow...).

As I said in my last post, this is done from aioPoll() which is called
from several places throughout the Unix VM. Go look at it.

> I mean... why? :-) Ian proposed I should just skip that line, 
> which I will try out, but I would really like to know why it's
> there from the beginning...

Which line?!

Cheers,
  - Andreas




More information about the Squeak-dev mailing list