OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "blimp/net/common.h" | 5 #include "blimp/net/common.h" |
6 | 6 |
7 #include <iostream> | |
8 | |
9 #include "blimp/common/proto/blimp_message.pb.h" | |
10 #include "net/base/ip_address_number.h" | |
11 | |
7 namespace blimp { | 12 namespace blimp { |
8 | 13 |
9 const size_t kMaxPacketPayloadSizeBytes = 1 << 16; // 64KB | 14 const size_t kMaxPacketPayloadSizeBytes = 1 << 16; // 64KB |
10 const size_t kPacketHeaderSizeBytes = 4; | 15 const size_t kPacketHeaderSizeBytes = 4; |
16 const uint16_t kDefaultTcpPort = 25467; | |
haibinlu
2016/01/04 19:45:45
this will be mapped to a different port in engine.
Kevin M
2016/01/04 20:42:13
Good point, removed it from common.h.
| |
17 | |
18 net::IPAddressNumber GetIPv4AnyAddress() { | |
19 net::IPAddressNumber output; | |
20 output.push_back(0); | |
21 output.push_back(0); | |
22 output.push_back(0); | |
23 output.push_back(0); | |
24 return output; | |
25 } | |
26 | |
27 std::ostream& operator<<(std::ostream& out, const BlimpMessage& message) { | |
28 // TODO(kmarshall): Log type-specific contextual detail. | |
29 out << "<BlimpMessage type=" << message.type() | |
30 << ", size=" << message.ByteSize() << ">"; | |
31 return out; | |
32 } | |
11 | 33 |
12 } // namespace blimp | 34 } // namespace blimp |
OLD | NEW |