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=
Review URL: https://chromiumcodereview.appspot.com//9720045
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5709 260f80e4-7a28-3924-810f-c04153c831b5
Changed the onError callback for sockets to take an exception argument.
First area to report errors for is name resolution.
Changed the IP address resolution from being synchronous with the
creation of the socket to being asynchronous thsough a lookup
service running on a native port. Currently this lookup service
is static on the socket class as we need to call it from a
factory method. We should probably add a separate name lookup
service at some point.
R=ager@google.com
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//9699017
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5640 260f80e4-7a28-3924-810f-c04153c831b5
1. Ignore the signal SIGPIPE on Linux and Mac OS
When reading from or writing to a closed pipe the signal SIGPIPE
is raised. The default handling of this is to terminate the
program. When signal SIGPIPE is ignored the read and write
returns EPIPE.
2. Wrong return type for stdio getter
3. When there is an error on a socket mark it as closed
4. Mark the pipe used for process exit status as a one way pipe
5. Add tests to test stdin, stdout and stderr in Dart scripts
R=ager@google.com
BUG=dart:536, dart:454
TEST=
Review URL: http://codereview.chromium.org//8662006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1793 260f80e4-7a28-3924-810f-c04153c831b5
Create handle objects for stdin/stdout/stderr. For Mac OS and
Linus the file descriptor numbers are used but on Windows the
handles are wrapped in an object.
The system handles for stdin/stdout/stderr on Windows does not
support overlapped IO. To mittigate this the write calls are
performed synchronously and the read calls are preformed in a
thread which posts the result through the completion potr where
it is handled as if it originated from overlapped IO through the
completion port. For now each call to read starts a new thread.
R=ager@google.com
BUG=
TEST=
Review URL: http://codereview.chromium.org//8574002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1533 260f80e4-7a28-3924-810f-c04153c831b5