From 3cf256b7694c0581ff65cd83c205340a849e2c72 Mon Sep 17 00:00:00 2001 From: orignal Date: Thu, 10 Apr 2014 15:34:51 -0400 Subject: [PATCH] removed sync Receive operation --- Streaming.cpp | 14 -------------- Streaming.h | 2 +- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/Streaming.cpp b/Streaming.cpp index 090a0d04..f8c63378 100644 --- a/Streaming.cpp +++ b/Streaming.cpp @@ -242,20 +242,6 @@ namespace stream m_ReceiveQueue.WakeUp (); } } - - size_t Stream::Receive (uint8_t * buf, size_t len, int timeout) - { - if (!m_IsOpen) return 0; - if (m_ReceiveQueue.IsEmpty ()) - { - if (!timeout) return 0; - if (!m_ReceiveQueue.Wait (timeout, 0)) - return 0; - } - - // either non-empty or we have received something - return ConcatenatePackets (buf, len); - } size_t Stream::ConcatenatePackets (uint8_t * buf, size_t len) { diff --git a/Streaming.h b/Streaming.h index b1706e4a..4d597345 100644 --- a/Streaming.h +++ b/Streaming.h @@ -80,7 +80,7 @@ namespace stream void HandleNextPacket (Packet * packet); size_t Send (uint8_t * buf, size_t len, int timeout); // timeout in seconds - size_t Receive (uint8_t * buf, size_t len, int timeout = 0); // returns 0 if timeout expired + template void AsyncReceive (const Buffer& buffer, ReceiveHandler handler, int timeout = 0);