Is it possible to reset the ServicePointManager?

前端 未结 2 465
野的像风
野的像风 2021-01-22 10:07

I am attempting to following the code similar to the one given at How does System.Net.Mail.SMTPClient do its local IP binding I am using Windows 7 and .Net 4.0 on a machine with

2条回答
  •  心在旅途
    2021-01-22 10:33

    I ran into a similar problem and wanted to reset ServicePointManager and changing certs for different outcomes of tests. The way that worked for me was to set MaxServicePointIdleTime to a low value, which would effectively reset it.

    ServicePointManager.MaxServicePointIdleTime = 1;
    

提交回复
热议问题