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:

  1. globally turn off nagle algorithm (hence, affecting connections don't want affect).
  2. increase maxservicepointidletime, servicepoint never recycled (probably bad idea? intuition tells me so).
  3. set sort of timer resets properties every n seconds n smaller recycling time servicepoint.
  4. 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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -