[kaffe] unix-pthreads accept timeout
Mathieu Dube
mdube@8d.com
Wed, 7 Aug 2002 11:30:39 -0400
--------------Boundary-00=_3FCH8IH134P2HDJJD50M
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
Well the thing is that it seems to be the same for the vm as it outputs this:
java.io.InterruptedIOException: Accept timed out or was interrupted
when there's a timeout.
Attached is a newer patch that does the same with the jthreadedTimedRead.
more comments welcome.
Later
-Mat
On Wednesday 07 August 2002 11:18, you wrote:
> > Ok,
> > I changed it. I also put a check to see if the timeout is 0 to pass NULL
> > to select() and added a timeout*1000 since usecs and millisecs arent the
> > same. My java programmer here seems to say it works.
>
> Why don't you use the structure suggested by the BREAK_IF_LATE
> macros and companions? If select returns EINTR (which I don't think
> is illegal), then your code thinks it's a timeout.
>
> - Godmar
--
Mathieu Dube -- mdube@8d.com
8D Technologies Inc.
http://www.8d.com
--------------Boundary-00=_3FCH8IH134P2HDJJD50M
Content-Type: text/x-c;
charset="iso-8859-1";
name="timeout.diff"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="timeout.diff"
ZGlmZiBrYWZmZS0xLjAueC1jdnMva2FmZmUva2FmZmV2bS9zeXN0ZW1zL3VuaXgtcHRocmVhZHMv
c3lzY2FsbHMuYyBrYWZmZS9rYWZmZS9rYWZmZXZtL3N5c3RlbXMvdW5peC1wdGhyZWFkcy9zeXNj
YWxscy5jCjc4YTc5LDk4Cj4gc3RhdGljIAo+IGludAo+IHdhaXRGb3JUaW1lb3V0KGludCBmZCwg
aW50IHRpbWVvdXQpewo+IAlmZF9zZXQgcnNldDsKPiAJc3RydWN0IHRpbWV2YWwgdHY7Cj4gCWlu
dCByZXQ7Cj4gCj4gCUZEX1pFUk8oJnJzZXQpOwo+IAlGRF9TRVQoZmQsJnJzZXQpOwo+IAl0di50
dl9zZWMgPSAwOyAKPiAJdHYudHZfdXNlYyA9IHRpbWVvdXQqMTAwMDsKPiAKPiAJaWYgKHRpbWVv
dXQgPT0g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