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

Side by Side Diff: runtime/bin/sync_socket_macos.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_MACOS) 8 #if defined(HOST_OS_MACOS)
9 9
10 #include "bin/sync_socket.h" 10 #include "bin/sync_socket.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 return -1; 50 return -1;
51 } 51 }
52 52
53 53
54 intptr_t SynchronousSocket::CreateConnect(const RawAddr& addr) { 54 intptr_t SynchronousSocket::CreateConnect(const RawAddr& addr) {
55 intptr_t fd = Create(addr); 55 intptr_t fd = Create(addr);
56 if (fd < 0) { 56 if (fd < 0) {
57 return fd; 57 return fd;
58 } 58 }
59 return Connect(fd, addr); 59 return Connect(fd, addr);
60 } 60 }
siva 2017/04/21 16:40:36 SynchronousSocket::Initialize() seems to be missin
zra 2017/04/22 06:29:28 Whoops. Added back.
61 61
62 62
63 intptr_t SynchronousSocket::Available(intptr_t fd) {
64 return SocketBase::Available(fd);
65 }
66
67
68 intptr_t SynchronousSocket::GetPort(intptr_t fd) {
69 return SocketBase::GetPort(fd);
70 }
71
72
73 SocketAddress* SynchronousSocket::GetRemotePeer(intptr_t fd, intptr_t* port) {
74 return SocketBase::GetRemotePeer(fd, port);
75 }
76
77
78 intptr_t SynchronousSocket::Read(intptr_t fd,
79 void* buffer,
80 intptr_t num_bytes) {
81 return SocketBase::Read(fd, buffer, num_bytes);
82 }
83
84
85 intptr_t SynchronousSocket::Write(intptr_t fd,
86 const void* buffer,
87 intptr_t num_bytes) {
88 return SocketBase::Write(fd, buffer, num_bytes);
89 }
90
91
63 void SynchronousSocket::ShutdownRead(intptr_t fd) { 92 void SynchronousSocket::ShutdownRead(intptr_t fd) {
64 VOID_NO_RETRY_EXPECTED(shutdown(fd, SHUT_RD)); 93 VOID_NO_RETRY_EXPECTED(shutdown(fd, SHUT_RD));
65 } 94 }
66 95
67 96
68 void SynchronousSocket::ShutdownWrite(intptr_t fd) { 97 void SynchronousSocket::ShutdownWrite(intptr_t fd) {
69 VOID_NO_RETRY_EXPECTED(shutdown(fd, SHUT_WR)); 98 VOID_NO_RETRY_EXPECTED(shutdown(fd, SHUT_WR));
70 } 99 }
71 100
101
102 void SynchronousSocket::Close(intptr_t fd) {
103 return SocketBase::Close(fd);
104 }
105
72 } // namespace bin 106 } // namespace bin
73 } // namespace dart 107 } // namespace dart
74 108
75 #endif // defined(HOST_OS_MACOS) 109 #endif // defined(HOST_OS_MACOS)
76 110
77 #endif // !defined(DART_IO_DISABLED) 111 #endif // !defined(DART_IO_DISABLED)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698