phase 5: transfer service
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
|
||||
namespace proto {
|
||||
constexpr uint16_t TCP_PORT = 8080;
|
||||
constexpr uint16_t MULTICAST_PORT = 8081;
|
||||
constexpr char MULTICAST_GROUP[] = "239.0.0.1";
|
||||
constexpr size_t BUF_SIZE = 65536;
|
||||
constexpr uint32_t MAX_FILENAME = 4096;
|
||||
constexpr uint32_t EOF_SENTINEL = 0;
|
||||
|
||||
// Wire layout per file:
|
||||
// [filename_len : uint32_t LE] — 0 == end-of-stream
|
||||
// [filename : filename_len bytes]
|
||||
// [file_size : uint64_t LE]
|
||||
// [file_data : file_size bytes]
|
||||
}
|
||||
Reference in New Issue
Block a user