OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef REMOTING_CLIENT_PLUGIN_HOST_CONNECTION_H_ |
| 6 #define REMOTING_CLIENT_PLUGIN_HOST_CONNECTION_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 |
| 10 namespace remoting { |
| 11 |
| 12 class HostConnection { |
| 13 public: |
| 14 HostConnection(); |
| 15 virtual ~HostConnection(); |
| 16 |
| 17 bool connect(const char* ip_address); |
| 18 bool connected() { |
| 19 return connected_; |
| 20 } |
| 21 |
| 22 bool read_data(char *buffer, int num_bytes); |
| 23 bool write_data(const char* buffer, int num_bytes); |
| 24 |
| 25 private: |
| 26 // True if we have a valid connection. |
| 27 bool connected_; |
| 28 |
| 29 // The socket for the connection. |
| 30 int sock_; |
| 31 |
| 32 DISALLOW_COPY_AND_ASSIGN(HostConnection); |
| 33 }; |
| 34 |
| 35 } // namespace remoting |
| 36 |
| 37 #endif // REMOTING_CLIENT_PLUGIN_HOST_CONNECTION_H_ |
OLD | NEW |