| 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_CONNECTION_H_ | 5 #ifndef SRC_SHARED_CONNECTION_H_ |
| 6 #define SRC_SHARED_CONNECTION_H_ | 6 #define SRC_SHARED_CONNECTION_H_ |
| 7 | 7 |
| 8 #ifndef FLETCH_ENABLE_LIVE_CODING | 8 #ifndef DARTINO_ENABLE_LIVE_CODING |
| 9 #error "connection.h is only available when live coding is enabled." | 9 #error "connection.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 #include "src/shared/platform.h" | 13 #include "src/shared/platform.h" |
| 14 | 14 |
| 15 namespace fletch { | 15 namespace dartino { |
| 16 | 16 |
| 17 class Socket; | 17 class Socket; |
| 18 | 18 |
| 19 class Buffer { | 19 class Buffer { |
| 20 public: | 20 public: |
| 21 Buffer(); | 21 Buffer(); |
| 22 ~Buffer(); | 22 ~Buffer(); |
| 23 | 23 |
| 24 void ClearBuffer(); | 24 void ClearBuffer(); |
| 25 void SetBuffer(uint8* buffer, int length); | 25 void SetBuffer(uint8* buffer, int length); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 49 void WriteDouble(double value); | 49 void WriteDouble(double value); |
| 50 void WriteBoolean(bool value); | 50 void WriteBoolean(bool value); |
| 51 void WriteBytes(const uint8* bytes, int length); | 51 void WriteBytes(const uint8* bytes, int length); |
| 52 void WriteString(const char* str); | 52 void WriteString(const char* str); |
| 53 void WriteTo(Socket* socket) const; | 53 void WriteTo(Socket* socket) const; |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 class Connection { | 56 class Connection { |
| 57 public: | 57 public: |
| 58 // Any change in [Opcode] must also be done in [VMCommandCode] in | 58 // Any change in [Opcode] must also be done in [VMCommandCode] in |
| 59 // pkg/fletchc/lib/vm_commands.dart. | 59 // pkg/dartino_compiler/lib/vm_commands.dart. |
| 60 enum Opcode { | 60 enum Opcode { |
| 61 // DO NOT MOVE! The handshake opcodes needs to be the first one as | 61 // DO NOT MOVE! The handshake opcodes needs to be the first one as |
| 62 // it is used to verify the compiler and vm versions. | 62 // it is used to verify the compiler and vm versions. |
| 63 kHandShake, | 63 kHandShake, |
| 64 kHandShakeResult, | 64 kHandShakeResult, |
| 65 | 65 |
| 66 kConnectionError, | 66 kConnectionError, |
| 67 kCompilerError, | 67 kCompilerError, |
| 68 kSessionEnd, | 68 kSessionEnd, |
| 69 kDebugging, | 69 kDebugging, |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 | 182 |
| 183 int Port(); | 183 int Port(); |
| 184 | 184 |
| 185 Connection* Accept(); | 185 Connection* Accept(); |
| 186 | 186 |
| 187 private: | 187 private: |
| 188 Socket* socket_; | 188 Socket* socket_; |
| 189 int port_; | 189 int port_; |
| 190 }; | 190 }; |
| 191 | 191 |
| 192 } // namespace fletch | 192 } // namespace dartino |
| 193 | 193 |
| 194 #endif // SRC_SHARED_CONNECTION_H_ | 194 #endif // SRC_SHARED_CONNECTION_H_ |
| OLD | NEW |