about IPv6
John M McIntosh
johnmci at smalltalkconsulting.com
Wed Aug 15 17:39:11 UTC 2007
On Aug 14, 2007, at 4:58 PM, Ian Piumarta wrote:
> The platform code for Unix is in SVN. For MacOS I guess John will
> just copy and paste as usual (and the result should work: I have
> tested the Unix code under Darwin).
I just use the unix socket code from the SVN tree since os-x drawin
is unix after all.
I have some changes related to EINTR (attached) for the old socket
code, but have not anyone tested it.
So for example socketReadable()
invokes recv() to see if the socket is readable.
If that got a EINTR the original code would return (-1) EOF
This likely is the wrong answer since you might expect back (1)
meaning data, or (0) meaning would block.
Thus something like sqSocketReceiveDataAvailable() does this below so
it *could* get a EINTR which would set the socket to
OtherEndClosed, which in fact is wrong.
if (SOCKETSTATE(s) == Connected)
{
int fd= SOCKET(s);
int n= socketReadable(fd);
if (n > 0)
{
FPRINTF((stderr, "receiveDataAvailable(%d) -> true\n", fd));
return true;
}
else if (n < 0)
{
FPRINTF((stderr, "receiveDataAvailable(%d): other end closed\n",
fd));
SOCKETSTATE(s)= OtherEndClosed;
}
--
========================================================================
===
John M. McIntosh <johnmci at smalltalkconsulting.com>
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
========================================================================
===
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sqUnixSocket.c.zip
Type: application/zip
Size: 11580 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20070815/860a0a13/sqUnixSocket.c.zip
-------------- next part --------------
More information about the Squeak-dev
mailing list
|