Sep 10 2020 04:24 AM - edited Sep 10 2020 04:25 AM
While doing some not heavy operations (like add admins, add content type) in SharePoint CSOM we are getting below error which is not reproducible but comes intermittently. Mainly different article pointing to client context.
"IOException*Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."
searched and found some articles as below. but still not getting clear solution.
Thanks, Keval
May 05 2021 05:08 AM
May 20 2021 08:13 AM
@Kevin Hoyt Me too.. same problem
May 21 2021 01:11 PM
May 21 2021 01:14 PM
Jun 16 2021 06:53 AM
Aug 18 2021 11:41 AM
@DonHeuvelman, did you ever get a solution?
Aug 18 2021 01:02 PM
@DonHeuvelman Do you get the problem if you slow the process down? Maybe put some sleep operations in at the end of each iteration. If not TLS related, perhaps SP is throttling you?
Aug 19 2021 05:29 AM
@dscore Yeah, sort of, we put the whole request in a loop and append a sleep to it.
So we can request multiple times at once, about 10 or 11. Whenever a following request fails with the given exception, you have to wait until the previous connection is closed and this takes a few seconds, we just wait in the thread and continu after a few seconds (we try again until it succeeds)
Elegant? Not at all.. but its sufficient enough for our goals. (if it looks stupid but it works.... it's not stupid .. well not really but you get the point ;) )