kustermann@google.com
e06874c751
Fix potential use-after-free bug in windows eventhandler
...
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//925443002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43725 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-12 13:47:45 +00:00
kustermann@google.com
70ca358a33
Send destroy events for each closed listening socket instead of waiting for all listening sockets to be done
...
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//914103002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43680 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-11 11:34:47 +00:00
kustermann@google.com
615d1a01ac
Reland "Introduce optional 'bool shared' parameter to ServerSocket.bind() ..."
...
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//913753002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43678 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-11 10:01:20 +00:00
kustermann@google.com
700bea9f78
Parenthesize expression using bit-wise and on windows
...
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//895533006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43640 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-10 12:17:54 +00:00
sgjesse@google.com
7b7ac3620a
Add support to specify the source address for socket connect
...
BUG=http://dartbug.com/22253
R=kustermann@google.com , lrn@google.com
Review URL: https://codereview.chromium.org//908873002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43638 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-10 11:56:51 +00:00
kustermann@google.com
74c0f65c89
Implement windows support for having multiple Dart_Port's registered on one OS socket
...
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//910863003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43631 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-10 10:08:49 +00:00
kustermann@google.com
3ea331e741
Introduce a kSetEventMaskCommand, some cleanups in windows eventhandler
...
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//900363004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43547 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-06 09:36:57 +00:00
kustermann@google.com
a7f50cd5d2
Move CircularLinkedList to eventhandler.h
...
Move constants and InterruptMessage to eventhandler.h
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43524 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-05 21:45:47 +00:00
kustermann@google.com
cae03aaf1a
Wait for eventhandler to shut down before exiting
...
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//875403006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43504 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-05 13:16:07 +00:00
kustermann@google.com
1d6231bacd
Revert "Introduce optional 'bool shared' parameter to ServerSocket.bind() ..."
...
Review URL: https://codereview.chromium.org//896213002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43476 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-04 16:00:21 +00:00
kustermann@google.com
3c6c29fee9
Introduce optional 'bool shared' parameter to ServerSocket.bind() ...
...
R=sgjesse@google.com , wibling@google.com
Review URL: https://codereview.chromium.org//879353003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43467 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-04 13:41:41 +00:00
johnmccutchan@google.com
93e840e859
Fix compilation warnings in Windows event handler
...
BUG=
Review URL: https://codereview.chromium.org//838693002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42649 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-06 22:51:00 +00:00
iposva@google.com
5a383e7add
- Make sure that the threads for dart::bin are in the correct namespace.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//471743002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39233 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-14 00:06:04 +00:00
iposva@google.com
58cf8abfd3
- MutexLocker needed by eventhandler_win.cc.
...
Review URL: https://codereview.chromium.org//467953002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39181 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-13 00:08:50 +00:00
iposva@google.com
4884b3124c
- More missing headers on Windows.
...
Review URL: https://codereview.chromium.org//463373002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39180 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-13 00:03:46 +00:00
iposva@google.com
14ecdbd66a
- Separate the thread implementation used in bin/ and vm/
...
to allow us to make VM specific changes.
R=asiva@google.com
Review URL: https://codereview.chromium.org//463993002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39172 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-12 23:19:53 +00:00
ajohnsen@google.com
d3e183b91a
Be sure we don't delete a ClientSocket, until 'connect' is completed.
...
BUG=
Review URL: https://codereview.chromium.org//426923003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38671 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-29 13:40:51 +00:00
ajohnsen@google.com
d481c8b61c
Start accepting incoming sockets earlier on Windows, to associate a at AcceptEx error to 'ServerSocket.bind'.
...
Note that I have not been able to reproduce the error, thus no test is added for this case.
BUG=http://code.google.com/p/dart/issues/detail?id=19815
R=whesse@google.com
Review URL: https://codereview.chromium.org//426613002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38606 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-28 11:36:35 +00:00
ajohnsen@google.com
cee2d6e82e
Correctly truncate in Windows eventhandler.
...
BUG=
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//323823002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37163 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-10 07:12:52 +00:00
ajohnsen@google.com
9ddf98ffb8
Mark handle as invalid, when datagram socket is closed.
...
BUG=
Review URL: https://codereview.chromium.org//315173003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37030 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-05 15:56:59 +00:00
ajohnsen@google.com
58e0c32205
Don't issue new directory reads, if we already got unhandled data.
...
BUG=
Review URL: https://codereview.chromium.org//319503005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37006 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-04 18:50:40 +00:00
ajohnsen@google.com
90db41af31
Fix previous fix, by still making 'handle' the socket.
...
BUG=
Review URL: https://codereview.chromium.org//316813006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36999 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-04 15:56:47 +00:00
ajohnsen@google.com
f8d735521c
Don't use same value for socket() and handle(), as they are different concepts.
...
BUG=
R=kasperl@google.com
Review URL: https://codereview.chromium.org//313083004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36995 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-04 14:16:50 +00:00
ajohnsen@google.com
69a7b746ef
Fix double-closing of handles in Windows EventHandler.
...
BUG=
R=kasperl@google.com
Review URL: https://codereview.chromium.org//315003002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36991 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-04 11:53:53 +00:00
ajohnsen@google.com
146f95135e
Use 'Directory.watch' on Windows in pkg/watcher, instead of pooling.
...
This is a close copy of MacOS, except for the special handling on mac, and the extra watcher on Windows for detecting if the watched folder is deleted.
BUG=https://code.google.com/p/dart/issues/detail?id=14428,https://code.google.com/p/dart/issues/detail?id=18108,http://code.google.com/p/dart/issues/detail?id=19189
R=kasperl@google.com , sgjesse@google.com
Review URL: https://codereview.chromium.org//312743002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36988 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-04 10:23:32 +00:00
ajohnsen@google.com
30f6999668
Don't try to send messages, when the port is not set.
...
BUG=https://code.google.com/p/dart/issues/detail?id=18402
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//273833003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35898 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-08 10:28:31 +00:00
ajohnsen@google.com
3e1058fdfd
Clean up windows eventhandler.
...
BUG=
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//265273002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35737 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-05 11:08:03 +00:00
ajohnsen@google.com
82d1382faa
Fix crash in raw_secure_server_socket_test.
...
We had a scenario where read&write events were requested after the socket was closed, leading to a use-after-free.
This also fixes a scenario where we didn't delete client sockets, when accepted sockets are ignored when closing a listening socket.
BUG=https://code.google.com/p/dart/issues/detail?id=18610
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//269003002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35732 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-05 09:17:26 +00:00
ajohnsen@google.com
f5b0a17b19
Use ConnectEx on Windows, to do async connect of sockets.
...
BUG=https://code.google.com/p/dart/issues/detail?id=18154
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//264613002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35622 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-01 10:48:43 +00:00
ajohnsen@google.com
3b29063492
Don't act on return-token commands on Windows.
...
BUG=
Review URL: https://codereview.chromium.org//199063004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33653 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-13 15:23:08 +00:00
ajohnsen@google.com
9a71498127
Make the event-handler handle backpreasure.
...
We now limit the number of active events per fd to 8.
BUG=
R=whesse@google.com
Review URL: https://codereview.chromium.org//198743002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33649 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-13 12:02:47 +00:00
ajohnsen@google.com
a5d145b1ca
Remove non-fatal prints from windows eventhandler.
...
BUG=
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//177803002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32964 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-24 14:31:39 +00:00
whesse@google.com
3a896318b6
Revert "Add lock to a file handle in windows event handler."
...
This reverts commit r32901. The lock causes a deadlock, and timeouts in tests.
BUG=
R=kustermann@google.com
Review URL: https://codereview.chromium.org//175223004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32906 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-21 17:00:41 +00:00
whesse@google.com
cad945de00
Add lock to a file handle in windows event handler.
...
BUG=
R=ajohnsen@google.com
Review URL: https://codereview.chromium.org//174013012
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32901 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-21 15:29:09 +00:00
ajohnsen@google.com
e3372e72e9
Remove SocketData and now only pass the dart port to epoll.
...
This avoids keeping extra data alive.
BUG=
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//171503009
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32846 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-20 08:56:54 +00:00
ajohnsen@google.com
2cf11a443f
Fix Windows event-handler, where write can 'complete' with 0 bytes written.
...
To match our design, we now treat this as a success write, as we expect the error to come on next issued write (which is exactly what happens).
BUG=
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//172363002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32788 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-19 13:22:46 +00:00
ajohnsen@google.com
140fddd06e
Make event-handlers edge-triggered and move socket-state to Dart.
...
This eliminates to pause/resume calls made in the previous one-shot based model.
BUG=
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//169383003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32780 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-19 09:44:26 +00:00
ajohnsen@google.com
0f52be7f63
Make std* blocking file-descriptors.
...
This will most likely be a performance regression when piping, that
we'll have to look into in the future (copying data through
message-passing).
BUG=
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//154273003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32715 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-17 10:06:35 +00:00
ajohnsen@google.com
05d70400d6
Send error-event if socket is marked for error.
...
BUG=http://code.google.com/p/dart/issues/detail?id=16544
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//143473006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32358 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-06 14:37:21 +00:00
sgjesse@google.com
d651bf7366
Handle failures to AcceptEx calls on Windows
...
R=ajohnsen@google.com
BUG=http://dartbug.com/11165
Review URL: https://codereview.chromium.org//110223007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31265 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-19 12:41:26 +00:00
sgjesse@google.com
7b70c2c267
Add UDP support to dart:io
...
Initial implementation of UDP support in dart:io
Added a RawDatagramSocket which gets the same events as a RawSocket
except that READ_CLOSED is never received.
The receive from a RawDatagramSocket returns a Datagram object where
the senders address and port is presten together with the data.
The send on a RawDatagramSocket takes data and the address and port of
the destination.
Extended the number of socket options to support UDP.
Added getting the socket options.
R=ajohnsen@google.com
BUG=http://dartbug.com/1975
Review URL: https://codereview.chromium.org//85993002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31098 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-12 15:45:25 +00:00
fschneider@google.com
8779bc8d7f
Optimize identical-comparisons based on propagated type information.
...
If the propagated type allows, eliminate the check for numbers at
identical operations in optimized code.
The previous optimizaton was done before full type propagation was run
and was therefore not very effective.
* Made flow-graph printing having no side-effects: calling Type() lazily
initializes the type_ and reaching_type_ fields of Value and Definition.
Access fields directly when printing instead.
Also, fixed two random spelling mistakes.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//27727002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28851 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-18 11:13:59 +00:00
ajohnsen@google.com
b568dd8e4a
Call correct FATAL macro in EventHandler.
...
BUG=
Review URL: https://codereview.chromium.org//25484007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28152 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-02 11:46:25 +00:00
ajohnsen@google.com
0420c6b8b7
Reuse thread when writing stdout/stderr on Windows.
...
BUG=https://code.google.com/p/dart/issues/detail?id=13541
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//25631005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28146 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-02 11:03:34 +00:00
ajohnsen@google.com
d11df78618
Make stdout and stderr async.
...
This required some minor changes to the Windows eventhandler, as we now spawn a new thread for writes (just like we do for reads).
BUG=https://code.google.com/p/dart/issues/detail?id=7218
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//23609060
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27811 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-24 11:47:53 +00:00
sgjesse@google.com
b8912cff07
Replace the memcpy macro with a lint check.
...
This fixes the build under libc++. It also allows us to check the
Windows and Android code. While at it, replace all uncaught instances
of memcpy with memmove.
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//23578046
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27700 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-20 12:25:08 +00:00
ajohnsen@google.com
38bae0af02
Add FileSystemWatcher class to dart:io.
...
BUG=
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//19263003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27048 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-03 12:43:08 +00:00
sgjesse@google.com
959456533f
Add Process.runSync for running processes synchronously
...
BUG=http://dartbug.com/1707
R=whesse@google.com
Review URL: https://codereview.chromium.org//21816002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26052 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-13 14:12:31 +00:00
ajohnsen@google.com
723930c88e
Close 'accepted' sockets when listening socket is closed. Fixes raw_server_socket_cancel_test.
...
BUG=https://code.google.com/p/dart/issues/detail?id=8675
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//19675009
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25258 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-22 08:54:54 +00:00
ajohnsen@google.com
2d72d895d4
Also check for pending write for FileHandles in EventHandler.
...
BUG=
R=kustermann@google.com
Review URL: https://codereview.chromium.org//19724005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25228 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-19 17:08:17 +00:00