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 REMOTING_HOST_HEARTBEAT_SENDER_H_ | 5 #ifndef REMOTING_HOST_HEARTBEAT_SENDER_H_ |
6 #define REMOTING_HOST_HEARTBEAT_SENDER_H_ | 6 #define REMOTING_HOST_HEARTBEAT_SENDER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 // rem:sequence-id="456" | 41 // rem:sequence-id="456" |
42 // xmlns:rem="google:remoting"> | 42 // xmlns:rem="google:remoting"> |
43 // <rem:signature>.signature.</rem:signature> | 43 // <rem:signature>.signature.</rem:signature> |
44 // </rem:heartbeat> | 44 // </rem:heartbeat> |
45 // </iq> | 45 // </iq> |
46 // | 46 // |
47 // Normally the heartbeat indicates that the host is healthy and ready to | 47 // Normally the heartbeat indicates that the host is healthy and ready to |
48 // accept new connections from a client, but the rem:heartbeat xml element can | 48 // accept new connections from a client, but the rem:heartbeat xml element can |
49 // optionally include a rem:host-offline-reason attribute, which indicates that | 49 // optionally include a rem:host-offline-reason attribute, which indicates that |
50 // the host cannot accept connections from the client (and might possibly be | 50 // the host cannot accept connections from the client (and might possibly be |
51 // shutting down). The value of the host-offline-reason attribute can be a | 51 // shutting down). The value of the host-offline-reason attribute can be either |
52 // string from host_exit_codes.cc (i.e. "INVALID_HOST_CONFIGURATION" string). | 52 // a string from host_exit_codes.cc (i.e. "INVALID_HOST_CONFIGURATION" string) |
| 53 // or one of kHostOfflineReasonXxx constants (i.e. "POLICY_READ_ERROR" string). |
53 // | 54 // |
54 // The sequence-id attribute of the heartbeat is a zero-based incrementally | 55 // The sequence-id attribute of the heartbeat is a zero-based incrementally |
55 // increasing integer unique to each heartbeat from a single host. | 56 // increasing integer unique to each heartbeat from a single host. |
56 // The Bot checks the value, and if it is incorrect, includes the | 57 // The Bot checks the value, and if it is incorrect, includes the |
57 // correct value in the result stanza. The host should then send another | 58 // correct value in the result stanza. The host should then send another |
58 // heartbeat, with the correct sequence-id, and increment the sequence-id in | 59 // heartbeat, with the correct sequence-id, and increment the sequence-id in |
59 // susbequent heartbeats. | 60 // susbequent heartbeats. |
60 // The signature is a base-64 encoded SHA-1 hash, signed with the host's | 61 // The signature is a base-64 encoded SHA-1 hash, signed with the host's |
61 // private RSA key. The message being signed is the full Jid concatenated with | 62 // private RSA key. The message being signed is the full Jid concatenated with |
62 // the sequence-id, separated by one space. For example, for the heartbeat | 63 // the sequence-id, separated by one space. For example, for the heartbeat |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 base::OneShotTimer<HeartbeatSender> host_offline_reason_timeout_timer_; | 173 base::OneShotTimer<HeartbeatSender> host_offline_reason_timeout_timer_; |
173 | 174 |
174 base::ThreadChecker thread_checker_; | 175 base::ThreadChecker thread_checker_; |
175 | 176 |
176 DISALLOW_COPY_AND_ASSIGN(HeartbeatSender); | 177 DISALLOW_COPY_AND_ASSIGN(HeartbeatSender); |
177 }; | 178 }; |
178 | 179 |
179 } // namespace remoting | 180 } // namespace remoting |
180 | 181 |
181 #endif // REMOTING_HOST_HEARTBEAT_SENDER_H_ | 182 #endif // REMOTING_HOST_HEARTBEAT_SENDER_H_ |
OLD | NEW |