Index: blimp/net/common.cc |
diff --git a/blimp/net/common.cc b/blimp/net/common.cc |
index 1663b300534f03ff610710b6d2630a5f7c04c427..4ba6c75c335c5bbe84fd5472d9e44b130b60157c 100644 |
--- a/blimp/net/common.cc |
+++ b/blimp/net/common.cc |
@@ -4,9 +4,31 @@ |
#include "blimp/net/common.h" |
+#include <iostream> |
+ |
+#include "blimp/common/proto/blimp_message.pb.h" |
+#include "net/base/ip_address_number.h" |
+ |
namespace blimp { |
const size_t kMaxPacketPayloadSizeBytes = 1 << 16; // 64KB |
const size_t kPacketHeaderSizeBytes = 4; |
+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.
|
+ |
+net::IPAddressNumber GetIPv4AnyAddress() { |
+ net::IPAddressNumber output; |
+ output.push_back(0); |
+ output.push_back(0); |
+ output.push_back(0); |
+ output.push_back(0); |
+ return output; |
+} |
+ |
+std::ostream& operator<<(std::ostream& out, const BlimpMessage& message) { |
+ // TODO(kmarshall): Log type-specific contextual detail. |
+ out << "<BlimpMessage type=" << message.type() |
+ << ", size=" << message.ByteSize() << ">"; |
+ return out; |
+} |
} // namespace blimp |