コード例 #1
0
/**
 * Called by an HighLevelReader when download is successfully finished.
 */
void HighLevelHttpConnection::downloadSuccess(MAHandle handle)
{
    close();
    deleteReader();
    deallocateData();
    dataDownloaded(handle, RES_OK);
}
コード例 #2
0
/**
 * Called by an HighLevelReader when there is a download error.
 */
void HighLevelHttpConnection::downloadError(int result)
{
    close();
    deleteReader();
    deallocateData();
    dataDownloaded(0, result);
}
コード例 #3
0
ファイル: clext.c プロジェクト: mpolney/clext
int main(void) {
	FILE *f;
	struct reader_t *r;

	f = fopen("CL_Images", "rb");
	if (f == NULL) {
		fprintf(stderr, "Failed to open CL_Images: %s\n", strerror(errno));
		return 1;
	}

	r = newReader(f);

	unpack(r, unpackCB);

	deleteReader(r);
	fclose(f);

	return 0;
}
コード例 #4
0
/**
 * This method is called when the HTTP request is complete.
 * Now all data is sent to the server and we can start reading
 * the reply and download data.
 */
void HighLevelHttpConnection::httpFinished(
    MAUtil::HttpConnection* connection,
    int result)
{
    // Known success status codes are 200 and 201.
    if (200 != result && 201 != result)
    {
        // There was an error.
        dataDownloaded(0, result);
        return;
    }

    // Start to read the result using a DownloadReader helper object.
    deleteReader();
    mReader = new HighLevelReaderThatReadsChunks(this);
    mReader->startRecvToData();

    // Next this that happens is that connReadFinished is called.
}
コード例 #5
0
ファイル: ProxyPort.hpp プロジェクト: jmachowinski/orocos_cpp
 ~OutputProxyPort()
 {
     deleteReader();
     port->disconnect();
 }