Fix for issue 1598.
Lexical scope comes before inherited names. Also, Static members
are not inherited and are not visible in subclasses.
Code in the subclass (or any other code for that matter) has to
qualify the names of these members with the class name.
We had a few tests that were wrong and only passed in the VM because
this was not implemented correctly.
Also had to fix code in frog and dartdoc.
I hope I ran enough tests. I built an all.deps tree using tools/build.py from the root directory, which brought up the frog and dartdoc issues.
Tested:
tools/test.py --compiler=dart2js --runtime=drt
tools/test.py -c none -r drt
tools/test.py -c frog -r drt
tools/test.py -r vm
Review URL: https://chromiumcodereview.appspot.com//10115005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6698 260f80e4-7a28-3924-810f-c04153c831b5
Change the streams onError callbacks to get an Exception argument on
all streams.
Added actual error handling to the socket streams.
As it is difficult to determine where an error should be reported I
decided to call all the registered onError callbacks, that is on the
socket itself and on both input and output stream.
Did some additional cleanup of the naming of OnError argument in some tests.
R=ager@google.com
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//9812007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5717 260f80e4-7a28-3924-810f-c04153c831b5
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
For the server keep track of the state of the connection and close the
socket when it is closed by the client. The client might close the
connection both when processing a request and while the connection is
an idle keep alive connection.
For the client keep track of the active connections as well as the
idle keep alive connections. When the client is closed make sure to
close all connections.
R=ajohnsen@google.com
BUG=none
TEST=tests/standalone/src/io/HttpShutdownTest.dart
Review URL: https://chromiumcodereview.appspot.com//9589001
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4932 260f80e4-7a28-3924-810f-c04153c831b5
The recent change to epoll on Linux and kqueue on Mac OS for getting
notifications from file descriptors caused the redirection of stdin,
stdout and stderr for the stand alone VM to stop working.
On Linux epoll failed when file descriptor 0, 1 or 2 redirected from
or to a file war registered. On Mac OS there was just no events
generated from kqueue.
The streams created for stdio, stdout and stderr is now of the correct
type and for file redirections no longer a socket object holding a
file descriptor for a regular file.
Added testing of stdio redirection using both pipes and files. These
tests are currently skipped on Windows.
Fixed handlin of short socket read when reading the process exit code.
Always close the socket port when not waiting for any events.
R=iposva@google.com
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//9360040
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4226 260f80e4-7a28-3924-810f-c04153c831b5
Boolean
Smi
Double
String
Array
The encoding uses the upper bits of the Dart_CObject type field for "marking" already written objects with their object id for generating backward references. After serialization these mark are removed.
Added the API Dart_PostCMessage for encoding and posting a Dart_CMessage structure.
Removed the API Dart_PostIntArray and used Dart_PostCMessage instead.
R=asive@google.com,turnidge@google.com
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//9104041
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3947 260f80e4-7a28-3924-810f-c04153c831b5
The accept method have been removed from the ServerSocket class and
the signature for the connectionHandler callback have been changed to
provide the accepted socket as an argument.
This is to avoid the possibility for accept to return null even in the
case of pending connection. This could happen if an error like EAGAIN,
EWOULDBLOCK and EINTR was returned by it OS accept call and previously
there was no way of propagating this without returning null from the
Dart call to accept.
R=ager@google.com
BUG=
TEST=
Review URL: http://codereview.chromium.org//8726031
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1889 260f80e4-7a28-3924-810f-c04153c831b5
When using stdout/stderr it is no longer necessary to explicitly
close the streams for the program to terminate. The automatic
close is handled by always closing the associated receive port
for write only streams when not waiting for any events. If a
close or error handler is installed for stdout/stderr these will
still keep the program alive.
For stdin better handling of the difference between sockets and
pipes have been immplemented. As a special case for stdin when
reading from a terminal the a POLLIN signal with 0 available
bytes is treated as end-of-file. This will trigger when pressing
ctrl-d in a terminal as POLLHUP is not set in that situation.
R=ager@google.com
BUG=
TEST=
Review URL: http://codereview.chromium.org//8533005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1507 260f80e4-7a28-3924-810f-c04153c831b5
Sockets now supports being half-closed for either reading or writing. When a socket is closed it is by default closed for both read and write and the underlying file descriptor is destroyed. However the socket close can be asked to only half-close the socket to send end of stream to the other end and still have the ability to receive more data.
The close event on a socket is only emitted when the socket is closed by the other end. Both half-close and full-close by the other end is reported as a close event. If a socket is already half closed the close event will automatically destroy the socket.
The streams on the sockets also takes advantage of this. A socket input stream will report a close event when the other end closed. A socket output stream will half-close the socket when close is called making it possible to still receive data on the input stream. When both streams have been closed the socket is destroyed.
For sockets operating on pipes they are initially created as half-closed for either reading or writing depending on which type of pipe a socket object is based on. A pipe for writing will start half-closed for reading so if it is only half-closed for writing the socket will still be destroyed. Same with a pipe for reading that will start half-closed for writing and when a close event is received half-closing the other direction will destroy the socket. Socket objects based on pipes are only exposed through streams.
Extended the socket close test to test a number of different scenarios.
Also refactor the socket data C++ object to encapsulate more socket information and operations.
Now the Linux and Mac OS versions are 100% the same as it turned out that using POLLRDHUP on Linux was not required any more.
R=ager@google.com
BUG=
TEST=
Review URL: http://codereview.chromium.org//8437090
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1196 260f80e4-7a28-3924-810f-c04153c831b5
Have both async and sync version for the file operations. The
thinking is that once you have used an async operation you will
not be allowed to use a sync one. Only sync versions currently
implemented.
Instead of having one input and one output stream associated with a
file we create new streams whenever needed. These get their own
underlying file descriptor so they do not interfere. This means
that FileStreams have to be explicitly closed.
R=sgjesse@google.com
BUG=
TEST=
Review URL: http://codereview.chromium.org//8399033
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@819 260f80e4-7a28-3924-810f-c04153c831b5
Most of the socket tests where written with closing both the server and client ends of the socket. However on Windows this can lead to errors once in a while (WSAECONNRESET). The tests now closes the socket in the client and and waits for a close event on the server side.
The readUntil on InputStream did not take data in the internal buffer into account. This has been fixed and the related test have been rewritten to check for two patterns which together will match all the input.
R=ager@google.com
BUG=
TEST=
Review URL: https://chromereviews.googleplex.com/3536016
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@126 260f80e4-7a28-3924-810f-c04153c831b5