DescriptionExtend dart:io error handling to all socket functions
There are currently no tests of the error handling, as it is hard to
create consistent tests. I have done some manual tests locally:
* Lowering the number of file descriptors available (ulimit -n) and hitting that limit
* Running two dart programs communicating and terminating one (using Ctrl-C)
* Running two dart programs communicating on two machines and pulling out the network cable.
If there is an error we always call the onError callback and never the onClosed callback.
On Windows there is the issue that both closing the connection correctly and terminating one end gives the same error (ERROR_NETNAME_DELETED) so both are reported as connection close. Pulling out the network cable gives a different (real) error on Windows though.
On Mac OS it turned out the for kqueue EV_EOF is also used to indicate errors with the error code set in the fflags field. EV_ERROR is only reported if there is an internal error in kevent processing (see http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man2/kqueue.2.html).
R=ager@google.com
BUG=
TEST=
Committed: https://code.google.com/p/dart/source/detail?r=5709
Patch Set 1 #Patch Set 2 : Added Mac OS and Windows implementation #Patch Set 3 : Fix Mac OS and Windows compile #
Total comments: 5
Patch Set 4 : Addressed review comments #
Messages
Total messages: 3 (0 generated)
|