All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.intel.jndn.utils.client.StreamingClient Maven / Gradle / Ivy

Go to download

Collection of tools to simplify synchronous and asynchronous data transfer over the NDN network

There is a newer version: 1.1.1
Show newest version
/*
 * jndn-utils
 * Copyright (c) 2015, Intel Corporation.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU Lesser General Public License,
 * version 3, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for
 * more details.
 */
package com.intel.jndn.utils.client;

import java.io.IOException;
import java.io.InputStream;
import net.named_data.jndn.Face;
import net.named_data.jndn.Interest;

/**
 * Define a client that can stream content bytes that are partitioned over
 * multiple packets.
 *
 * @author Andrew Brown 
 */
public interface StreamingClient {

  /**
   * Asynchronously request a packet over the network and retrieve the
   * partitioned content bytes as an input stream
   *
   * @param face the {@link Face} on which to make the request; call
   * {@link Face#processEvents()} separately to complete the request
   * @param interest the {@link Interest} to send over the network
   * @param partitionMarker the byte marker identifying how the data packets are
   * partitioned (e.g. segmentation, see
   * http://named-data.net/doc/tech-memos/naming-conventions.pdf)
   * @return a stream of content bytes
   * @throws IOException if the stream setup fails
   */
  public InputStream getStreamAsync(Face face, Interest interest, SegmentationType partitionMarker) throws IOException;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy