| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef TOOLS_ANDROID_FORWARDER2_COMMAND_H_ | 5 #ifndef TOOLS_ANDROID_FORWARDER2_COMMAND_H_ |
| 6 #define TOOLS_ANDROID_FORWARDER2_COMMAND_H_ | 6 #define TOOLS_ANDROID_FORWARDER2_COMMAND_H_ |
| 7 | 7 |
| 8 | 8 |
| 9 namespace forwarder2 { | 9 namespace forwarder2 { |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 UNLISTEN_ERROR, | 29 UNLISTEN_ERROR, |
| 30 UNLISTEN_SUCCESS, | 30 UNLISTEN_SUCCESS, |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 } // namespace command | 33 } // namespace command |
| 34 | 34 |
| 35 bool ReadCommand(Socket* socket, | 35 bool ReadCommand(Socket* socket, |
| 36 int* port_out, | 36 int* port_out, |
| 37 command::Type* command_type_out); | 37 command::Type* command_type_out); |
| 38 | 38 |
| 39 bool ReadCommandWithTimeout(Socket* socket, |
| 40 int* port_out, |
| 41 command::Type* command_type_out, |
| 42 int timeout_secs); |
| 43 |
| 39 // Helper function to read the command from the |socket| and return true if the | 44 // Helper function to read the command from the |socket| and return true if the |
| 40 // |command| is equal to the given command parameter. | 45 // |command| is equal to the given command parameter. |
| 41 bool ReceivedCommand(command::Type command, Socket* socket); | 46 bool ReceivedCommand(command::Type command, Socket* socket); |
| 42 | 47 |
| 48 bool ReceivedCommandWithTimeout(command::Type command, |
| 49 Socket* socket, |
| 50 int timeout_secs); |
| 51 |
| 43 bool SendCommand(command::Type command, int port, Socket* socket); | 52 bool SendCommand(command::Type command, int port, Socket* socket); |
| 44 | 53 |
| 45 } // namespace forwarder | 54 } // namespace forwarder |
| 46 | 55 |
| 47 #endif // TOOLS_ANDROID_FORWARDER2_COMMAND_H_ | 56 #endif // TOOLS_ANDROID_FORWARDER2_COMMAND_H_ |
| OLD | NEW |