On 03/26/2011 11:09 AM, Holger Hans Peter Freyther wrote:
On 03/25/2011 10:01 PM, Holger Hans Peter Freyther wrote:
recvfrom(4, 0xb35bf7bc, 1024, 0, 0, 0) = -1 ECONNRESET (Connection reset by
peer)
okay, 945cca8737d716e2436aaa064c2c6aed02d34627 of 11th of August 2008
introduced the following to cint.c:get_errno():
if (old == ESHUTDOWN || old == ECONNRESET
|| old == ECONNABORTED || old == ENETRESET)
return 0;
this explains why the connection refused is working but the connection reset
(due using tcpkill) will fail. The question is how to go forward? So somehow I
want to get a EndOfStream or a FileError.
Yes, your original idea of returning 0 now is correct. checkError will
return 0 for you:
diff --git a/kernel/FileDescr.st b/kernel/FileDescr.st
index f424cd2..d2291d1 100644
--- a/kernel/FileDescr.st
+++ b/kernel/FileDescr.st
@@ -797,7 +797,8 @@ do arbitrary processing on the files.'>
fileOp: 3
with: aCollection
with: position + available
- with: (position + n - 1 min: aCollection size).
+ with: (position + n - 1 min: aCollection size)
+ ifFail: [self checkError].
count := count + available.
count = 0 ifTrue: [atEnd := true].
^count
@@ -817,7 +818,8 @@ do arbitrary processing on the files.'>
fileOp: 2
with: aCollection
with: cur
- with: last.
+ with: last
+ ifFail: [self checkError].
result = 0 ifTrue: [^cur - position].
cur := cur + result].
^cur - position
(untested).
Paolo
_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk