Socket.select interrupted system call because of GC
David Nadlinger
code at klickverbot.at
Sat Aug 3 12:38:09 PDT 2013
On Saturday, 3 August 2013 at 15:59:30 UTC, Marek Janukowicz
wrote:
> It's really nice to have some chat about the correctness of
> example code
> snippets, but can anyone help me with the original issue? :)
Sorry, apparently I forgot to include the actual content:. ;)
Socket.select is an ancient (in D terms) API; you just need to
handle the returned error code manually and retry if the errno is
actually EINTR resp. its WinSock equivalent.
See
https://github.com/apache/thrift/blob/master/lib/d/src/thrift/server/transport/socket.d#L144
for a production-tested implementation. When I wrote that code,
it wasn't possible to do this in a platform-independent way using
std.socket (see
https://github.com/apache/thrift/blob/master/lib/d/src/thrift/internal/socket.d
for the used constants), and I don't think it is now either.
David
More information about the Digitalmars-d-learn
mailing list