diff options
author | Mauro Sardara <msardara@cisco.com> | 2019-09-10 16:29:48 +0200 |
---|---|---|
committer | Mauro Sardara <msardara@cisco.com> | 2019-09-10 14:38:22 +0000 |
commit | 288f00b322b6573c637e5567c528a4ff9ab5bfba (patch) | |
tree | db12d2885a974b65e638220b14ffbac8dab6316f /libtransport/src/hicn/transport/interfaces/socket_producer.h | |
parent | 822bd391506fd3f0afdc96ea441710fd0787c98b (diff) |
[HICN-273] Add zero copy produce() API to RTC producer socket.
This API allows to transfer the ownership of the packet from the application to the libtransport, thus avoiding to copy the packet.
Change-Id: Ic26b15783648b9e8821f71e47a2d9f5130474510
Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'libtransport/src/hicn/transport/interfaces/socket_producer.h')
-rw-r--r-- | libtransport/src/hicn/transport/interfaces/socket_producer.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libtransport/src/hicn/transport/interfaces/socket_producer.h b/libtransport/src/hicn/transport/interfaces/socket_producer.h index cd1c5a374..18adbf4a7 100644 --- a/libtransport/src/hicn/transport/interfaces/socket_producer.h +++ b/libtransport/src/hicn/transport/interfaces/socket_producer.h @@ -62,6 +62,10 @@ class ProducerSocket : public Socket<BasePortal>, void produce(ContentObject &content_object); virtual void produce(const uint8_t *buffer, size_t buffer_size) { + produce(utils::MemBuf::copyBuffer(buffer, buffer_size)); + } + + virtual void produce(std::unique_ptr<utils::MemBuf> &&buffer) { // This API is meant to be used just with the RTC producer. // Here it cannot be used since no name for the content is specified. throw errors::NotImplementedException(); |