简体   繁体   中英

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

I have a ASP.NET Web API project which calls a service that is written in delphi. This connection works perfectly until the data stream that I am getting from the service gets too big (the delphi service is just reading some data from the database, so no files are being sent between them).

Now, of course I have increased the MaxBufferSize but at some point it gets ridiculous and now I am looking for a more sophisticated solution. So I came across async (every method that I have in my delphi service is also available as async, thanks Microsoft). But even when I call my function as async I still get an error when the data stream is bigger than the set buffer size (actually I don't get an error, the execution just stops at await GetData . So, is there a possibillity to process the data that I am getting from my service in chunks ? For example, I set the max size of the data stream, and the function keeps fetching until I get all data ?

Thanks

Async has nothing to do with buffer sizes or streaming.

So, is there a possibillity to process the data that I am getting from my service in chunks?

Yes, this is what you need. All web service APIs that I know support streaming. WCF and HttpClient certainly do. A search for eg "httpclient stream response" should get you going.

Async IO is not needed here as far as I can tell from the information given.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM