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 // This file defines the interface for peer-to-peer transport. There | 5 // This file defines the interface for peer-to-peer transport. There |
6 // are two types of transport: StreamTransport and DatagramTransport. | 6 // are two types of transport: StreamTransport and DatagramTransport. |
7 // They must both be created using TransportFactory instances and they | 7 // They must both be created using TransportFactory instances and they |
8 // provide the same interface, except that one should be used for | 8 // provide the same interface, except that one should be used for |
9 // reliable stream connection and the other one for unreliable | 9 // reliable stream connection and the other one for unreliable |
10 // datagram connection. The Transport interface itself doesn't provide | 10 // datagram connection. The Transport interface itself doesn't provide |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
45 class ChannelAuthenticator; | 45 class ChannelAuthenticator; |
46 struct TransportConfig; | 46 struct TransportConfig; |
47 | 47 |
48 struct TransportRoute { | 48 struct TransportRoute { |
49 enum RouteType { | 49 enum RouteType { |
50 DIRECT, | 50 DIRECT, |
51 STUN, | 51 STUN, |
52 RELAY, | 52 RELAY, |
53 }; | 53 }; |
54 | 54 |
55 TransportRoute(); | |
56 ~TransportRoute(); | |
57 | |
58 std::string GetTypeString() const; | |
simonmorris
2012/03/19 22:17:05
Could this expose a RouteType, instead of a string
Sergey Ulanov
2012/03/19 23:21:03
This is a struct and the type field is public. Thi
| |
59 | |
55 RouteType type; | 60 RouteType type; |
56 net::IPEndPoint remote_address; | 61 net::IPEndPoint remote_address; |
57 net::IPEndPoint local_address; | 62 net::IPEndPoint local_address; |
58 }; | 63 }; |
59 | 64 |
60 class Transport : public base::NonThreadSafe { | 65 class Transport : public base::NonThreadSafe { |
61 public: | 66 public: |
62 class EventHandler { | 67 class EventHandler { |
63 public: | 68 public: |
64 EventHandler() {}; | 69 EventHandler() {}; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
139 virtual scoped_ptr<DatagramTransport> CreateDatagramTransport() = 0; | 144 virtual scoped_ptr<DatagramTransport> CreateDatagramTransport() = 0; |
140 | 145 |
141 private: | 146 private: |
142 DISALLOW_COPY_AND_ASSIGN(TransportFactory); | 147 DISALLOW_COPY_AND_ASSIGN(TransportFactory); |
143 }; | 148 }; |
144 | 149 |
145 } // namespace protocol | 150 } // namespace protocol |
146 } // namespace remoting | 151 } // namespace remoting |
147 | 152 |
148 #endif // REMOTING_PROTOCOL_TRANSPORT_H_ | 153 #endif // REMOTING_PROTOCOL_TRANSPORT_H_ |
OLD | NEW |