Quantcast
Viewing all articles
Browse latest Browse all 1535

How to refresh caches hosts file for WCF HTTP Connection

I have a server and client application that uses a WCF HTTPS connection. They both use a certificate and therefore the client needs to use a DNS to connect to the server.

In the system's hosts file under "C:\Windows\System32\drivers\etc" there is correctly an entry which maps the DNS name to the server IP Address.

The client application is one to many meaning it allows the user to enter the IP address of the server and it will create a connection. Implicitly the client application updates the line in the system hosts file related to this DNS to include this IP address and passes the DNS to the connection.

This all works without a problem on any server on different systems without an issue when first starting the application. It will update the hosts file and correctly connect to any server.

The problem I'm having is that when disconnecting and then reconnecting to a different IP address, the connection keeps being made on the first IP address the client connected to this instance of the client application starting.

The hosts file is being updated without an issue with the new IP Address but for some reason the connection still goes to the original one. Once again this all works when restarting the client and then putting in a different IP address. It seems like something is being cached somewhere for the WCF connection when trying to disconnect/reconnect under a single instance of the client.

Has anyone had this issue? Does anyone know how to refresh any type of cache that may exist for a WCF connection?


Viewing all articles
Browse latest Browse all 1535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>