| 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 #ifndef RUNTIME_BIN_SYNC_SOCKET_H_ | 5 #ifndef RUNTIME_BIN_SYNC_SOCKET_H_ |
| 6 #define RUNTIME_BIN_SYNC_SOCKET_H_ | 6 #define RUNTIME_BIN_SYNC_SOCKET_H_ |
| 7 | 7 |
| 8 #if defined(DART_IO_DISABLED) | 8 #if defined(DART_IO_DISABLED) |
| 9 #error "sync_socket.h can only be included on builds with IO enabled" | 9 #error "sync_socket.h can only be included on builds with IO enabled" |
| 10 #endif | 10 #endif |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 static bool Initialize(); | 26 static bool Initialize(); |
| 27 | 27 |
| 28 static intptr_t CreateConnect(const RawAddr& addr); | 28 static intptr_t CreateConnect(const RawAddr& addr); |
| 29 | 29 |
| 30 static Dart_Handle SetSocketIdNativeField(Dart_Handle handle, | 30 static Dart_Handle SetSocketIdNativeField(Dart_Handle handle, |
| 31 SynchronousSocket* socket); | 31 SynchronousSocket* socket); |
| 32 static Dart_Handle GetSocketIdNativeField(Dart_Handle socket_obj, | 32 static Dart_Handle GetSocketIdNativeField(Dart_Handle socket_obj, |
| 33 SynchronousSocket** socket); | 33 SynchronousSocket** socket); |
| 34 | 34 |
| 35 static intptr_t Available(intptr_t fd); |
| 36 static intptr_t GetPort(intptr_t fd); |
| 37 static SocketAddress* GetRemotePeer(intptr_t fd, intptr_t* port); |
| 38 static intptr_t Read(intptr_t fd, void* buffer, intptr_t num_bytes); |
| 39 static intptr_t Write(intptr_t fd, const void* buffer, intptr_t num_bytes); |
| 40 |
| 35 static void ShutdownRead(intptr_t fd); | 41 static void ShutdownRead(intptr_t fd); |
| 36 static void ShutdownWrite(intptr_t fd); | 42 static void ShutdownWrite(intptr_t fd); |
| 43 static void Close(intptr_t fd); |
| 37 | 44 |
| 38 private: | 45 private: |
| 39 static const int kClosedFd = -1; | 46 static const int kClosedFd = -1; |
| 40 | 47 |
| 41 intptr_t fd_; | 48 intptr_t fd_; |
| 42 | 49 |
| 43 DISALLOW_COPY_AND_ASSIGN(SynchronousSocket); | 50 DISALLOW_COPY_AND_ASSIGN(SynchronousSocket); |
| 44 }; | 51 }; |
| 45 | 52 |
| 46 } // namespace bin | 53 } // namespace bin |
| 47 } // namespace dart | 54 } // namespace dart |
| 48 | 55 |
| 49 #endif // RUNTIME_BIN_SYNC_SOCKET_H_ | 56 #endif // RUNTIME_BIN_SYNC_SOCKET_H_ |
| OLD | NEW |