'Wrapper to receive data from the cached stream or socket.'

def _recv(self, recv_size):

    if (recv_size <= 0):
        return None
    data_from_cached = ''
    data_from_socket = ''
    if (len(self.cached_stream) > 0):
        read_from_cached = min(len(self.cached_stream), recv_size)
        data_from_cached += self.cached_stream[:read_from_cached]
        self.cached_stream = self.cached_stream[read_from_cached:]
        recv_size -= read_from_cached
    if (recv_size > 0):
        data_from_socket = self._socket.recv(recv_size)
    return (data_from_cached + data_from_socket)
