OLD | NEW |
1 // Copyright (c) 2014, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dartino 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 #ifndef SRC_SHARED_NATIVE_SOCKET_H_ | 5 #ifndef SRC_SHARED_NATIVE_SOCKET_H_ |
6 #define SRC_SHARED_NATIVE_SOCKET_H_ | 6 #define SRC_SHARED_NATIVE_SOCKET_H_ |
7 | 7 |
8 #ifndef FLETCH_ENABLE_LIVE_CODING | 8 #ifndef DARTINO_ENABLE_LIVE_CODING |
9 #error "native_socket.h is only available when live coding is enabled." | 9 #error "native_socket.h is only available when live coding is enabled." |
10 #endif | 10 #endif |
11 | 11 |
12 #include "src/shared/globals.h" | 12 #include "src/shared/globals.h" |
13 | 13 |
14 namespace fletch { | 14 namespace dartino { |
15 | 15 |
16 class Socket { | 16 class Socket { |
17 public: | 17 public: |
18 Socket(); | 18 Socket(); |
19 | 19 |
20 virtual ~Socket(); | 20 virtual ~Socket(); |
21 | 21 |
22 bool Connect(const char* host, int port); | 22 bool Connect(const char* host, int port); |
23 | 23 |
24 void Bind(const char* host, int port); | 24 void Bind(const char* host, int port); |
(...skipping 15 matching lines...) Expand all Loading... |
40 private: | 40 private: |
41 struct SocketData; | 41 struct SocketData; |
42 | 42 |
43 explicit Socket(SocketData* data); | 43 explicit Socket(SocketData* data); |
44 | 44 |
45 bool ShouldRetryAccept(int error); | 45 bool ShouldRetryAccept(int error); |
46 | 46 |
47 SocketData* data_; | 47 SocketData* data_; |
48 }; | 48 }; |
49 | 49 |
50 } // namespace fletch | 50 } // namespace dartino |
51 | 51 |
52 #endif // SRC_SHARED_NATIVE_SOCKET_H_ | 52 #endif // SRC_SHARED_NATIVE_SOCKET_H_ |
OLD | NEW |