Q: How to prevent WCF NetTCP message size quota exceeded -
is there effective ways prevent message size quota exceeded nettcp service returns undetermined-sized collection? example have following service:
public list<string> getdirinfo(string path) { list<string> result; result = new list<string>(directory.enumeratedirectories(path)); result.addrange(new list<string>(directory.enumeratefiles(path))); return result; }
which returns list of directories , files in given path. @ times, reached message size quota, e.g. return c:\windows\system32
.
without changing message size quota, best way handle or prevent sort of service call? few ways can think of:
- convert
stream
service call - implement
pagination
- as prevention, check size of
result
prior returning. - implement callback mechanism service return series of fixed sized result client.
is there wcf configuration returned message split multiple packets , reconstruct clr
while confining message size quota.
edit:
i saw several postings on similar subject matter, involved in changing message size. do not want change default message size minimized dos attacks.
i want advise on best practices , how guys handling/implementing such case returning result might exceed message size quota.