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

Side by Side Diff: runtime/bin/sync_socket_fuchsia.cc

Issue 2830273002: [dart:io][windows] Implements RawSynchronousSocket (Closed)
Patch Set: Fix test and statuses 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #if !defined(DART_IO_DISABLED) 5 #if !defined(DART_IO_DISABLED)
6 6
7 #include "platform/globals.h" 7 #include "platform/globals.h"
8 #if defined(HOST_OS_FUCHSIA) 8 #if defined(HOST_OS_FUCHSIA)
9 9
10 #include "bin/sync_socket.h" 10 #include "bin/sync_socket.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 intptr_t SynchronousSocket::CreateConnect(const RawAddr& addr) { 57 intptr_t SynchronousSocket::CreateConnect(const RawAddr& addr) {
58 intptr_t fd = Create(addr); 58 intptr_t fd = Create(addr);
59 if (fd < 0) { 59 if (fd < 0) {
60 return fd; 60 return fd;
61 } 61 }
62 return Connect(fd, addr); 62 return Connect(fd, addr);
63 } 63 }
64 64
65 65
66 intptr_t SynchronousSocket::Available(intptr_t fd) {
67 return SocketBase::Available(fd);
68 }
69
70
71 intptr_t SynchronousSocket::GetPort(intptr_t fd) {
72 return SocketBase::GetPort(fd);
73 }
74
75
76 SocketAddress* SynchronousSocket::GetRemotePeer(intptr_t fd, intptr_t* port) {
77 return SocketBase::GetRemotePeer(fd, port);
78 }
79
80
81 intptr_t SynchronousSocket::Read(intptr_t fd,
82 void* buffer,
83 intptr_t num_bytes) {
84 return SocketBase::Read(fd, buffer, num_bytes);
85 }
86
87
88 intptr_t SynchronousSocket::Write(intptr_t fd,
89 const void* buffer,
90 intptr_t num_bytes) {
91 return SocketBase::Write(fd, buffer, num_bytes);
92 }
93
94
66 void SynchronousSocket::ShutdownRead(intptr_t fd) { 95 void SynchronousSocket::ShutdownRead(intptr_t fd) {
67 VOID_NO_RETRY_EXPECTED(shutdown(fd, SHUT_RD)); 96 VOID_NO_RETRY_EXPECTED(shutdown(fd, SHUT_RD));
68 } 97 }
69 98
70 99
71 void SynchronousSocket::ShutdownWrite(intptr_t fd) { 100 void SynchronousSocket::ShutdownWrite(intptr_t fd) {
72 VOID_NO_RETRY_EXPECTED(shutdown(fd, SHUT_WR)); 101 VOID_NO_RETRY_EXPECTED(shutdown(fd, SHUT_WR));
73 } 102 }
74 103
104
105 void SynchronousSocket::Close(intptr_t fd) {
106 return SocketBase::Close(fd);
107 }
108
75 } // namespace bin 109 } // namespace bin
76 } // namespace dart 110 } // namespace dart
77 111
78 #endif // defined(HOST_OS_FUCHSIA) 112 #endif // defined(HOST_OS_FUCHSIA)
79 113
80 #endif // !defined(DART_IO_DISABLED) 114 #endif // !defined(DART_IO_DISABLED)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698