c# - The correct way to permanently set properties on a ServicePoint -
i turn off nagle algorithm on specific connection (in case - elasticsearch server).
my code looks this:
servicepointmanager.findservicepoint(new uri(uriwithoutlocalpath)).usenaglealgorithm = false;
the problem servicepoint
object being recycled after while, causes lose setting. therefore, can't run code once, @ system startup. seem have several options in front of me:
- globally turn off nagle algorithm (hence, affecting connections don't want affect).
- increase maxservicepointidletime,
servicepoint
never recycled (probably bad idea? intuition tells me so). - set sort of timer resets properties every n seconds n smaller recycling time
servicepoint
. - reset properties every time use connection.
i don't of these options, either affect other things in system, or seem complex want (like timer option). seems me there should simple solution this. ideas?
Comments
Post a Comment