C # webservice call, buffer too small (Async?)

I have an ASP.NET Web API project that calls a service written in delphi. This connection works fine as long as the data stream I receive from the service doesn't get too big (the delphi service just reads some data from the database, so no files are sent between them).

Now, of course, I increased the MaxBufferSize, but at some point it gets ridiculous and now I am looking for a more complex solution. So I ran into async (every method I have in my delphi service is also available as async, thanks to Microsoft). But even when I call my async function, I still get an error when the data stream is larger than the given buffer size (I don't actually get an error, execution just stops at await GetData

. So is there any way to process the data I do I get from the service in chunks? For example, I set the maximum size of the data stream and the function keeps fetching until I get all the data?

thank

+3


source to share


1 answer


Async has nothing to do with buffer sizes or streaming.

So, is it possible to process the data I receive from the service in chunks?



Yes, this is what you need. All web service APIs I know support streaming. WCF and HttpClient certainly do. Search for example. The "httpclient response response" should catch you.

Async IO is not required here as far as I can tell from the information provided.

+1


source







All Articles