Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Unified Diff: runtime/bin/socket.cc

Issue 2830273002: [dart:io][windows] Implements RawSynchronousSocket (Closed)
Patch Set: Fix Linux build Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/process_win.cc ('k') | runtime/bin/socket_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket.cc
diff --git a/runtime/bin/socket.cc b/runtime/bin/socket.cc
index 52b1280ffbaf4c2e154ed7659339fdb4199bfcaa..89d5459db32be6ea77f8bf72436cfc198d915282 100644
--- a/runtime/bin/socket.cc
+++ b/runtime/bin/socket.cc
@@ -353,7 +353,8 @@ void FUNCTION_NAME(Socket_Read)(Dart_NativeArguments args) {
Dart_PropagateError(result);
}
ASSERT(buffer != NULL);
- intptr_t bytes_read = SocketBase::Read(socket->fd(), buffer, length);
+ intptr_t bytes_read =
+ SocketBase::Read(socket->fd(), buffer, length, SocketBase::kAsync);
if (bytes_read == length) {
Dart_SetReturnValue(args, result);
} else if (bytes_read > 0) {
@@ -393,8 +394,9 @@ void FUNCTION_NAME(Socket_RecvFrom)(Dart_NativeArguments args) {
reinterpret_cast<uint8_t*>(malloc(65536));
}
RawAddr addr;
- intptr_t bytes_read = SocketBase::RecvFrom(
- socket->fd(), isolate_data->udp_receive_buffer, 65536, &addr);
+ intptr_t bytes_read =
+ SocketBase::RecvFrom(socket->fd(), isolate_data->udp_receive_buffer,
+ 65536, &addr, SocketBase::kAsync);
if (bytes_read == 0) {
Dart_SetReturnValue(args, Dart_Null());
return;
@@ -474,7 +476,8 @@ void FUNCTION_NAME(Socket_WriteList)(Dart_NativeArguments args) {
}
ASSERT((offset + length) <= len);
buffer += offset;
- intptr_t bytes_written = SocketBase::Write(socket->fd(), buffer, length);
+ intptr_t bytes_written =
+ SocketBase::Write(socket->fd(), buffer, length, SocketBase::kAsync);
if (bytes_written >= 0) {
Dart_TypedDataReleaseData(buffer_obj);
if (short_write) {
@@ -516,8 +519,8 @@ void FUNCTION_NAME(Socket_SendTo)(Dart_NativeArguments args) {
}
ASSERT((offset + length) <= len);
buffer += offset;
- intptr_t bytes_written =
- SocketBase::SendTo(socket->fd(), buffer, length, addr);
+ intptr_t bytes_written = SocketBase::SendTo(socket->fd(), buffer, length,
+ addr, SocketBase::kAsync);
if (bytes_written >= 0) {
Dart_TypedDataReleaseData(buffer_obj);
Dart_SetReturnValue(args, Dart_NewInteger(bytes_written));
« no previous file with comments | « runtime/bin/process_win.cc ('k') | runtime/bin/socket_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698