| 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_ANDROID) | 8 #if defined(HOST_OS_ANDROID) |
| 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 Loading... |
| 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_ANDROID) | 112 #endif // defined(HOST_OS_ANDROID) |
| 79 | 113 |
| 80 #endif // !defined(DART_IO_DISABLED) | 114 #endif // !defined(DART_IO_DISABLED) |
| OLD | NEW |