Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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) |
| OLD | NEW |