net: add packet constructor which accepts static data

This commit is contained in:
Tomasz Grabiec
2014-09-16 13:59:09 +02:00
parent 269b05afc2
commit 623129b45b

View File

@@ -131,6 +131,10 @@ class packet final {
};
std::unique_ptr<impl> _impl;
public:
static packet from_static_data(const char* data, size_t len) {
return {fragment{(char*)data, len}, [] {}};
}
// build empty packet
packet();
// move existing packet