e.g. Dial-up connection and VPN
- use INTERNET_OPTION_PROXY_SETTINGS_CHANGED instead of INTERNET_OPTION_SETTINGS_CHANGED
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
Be sure to install develop package and runtime library if needed
since Visual Studio has 4.6.1 included.
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
- Use readonly object as lock
Info from stackoverflow:
If I want to be sure that it will be locked for all threads inside my
application:
The lock object has to be static, if it locks access to static state.
Otherwise it has to be instance, because there's no need to lock state of
one class instance, and prevent other threads to work with another class
instance at the same time.
everyone says that the object has to be "readonly" I didn't found the
reason
Well, it doesn't have to be. This is just a best practice, which helps you
to avoid errors.
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
Squashed commit of the following:
commit 48eb4d8839
Author: Syrone Wong <wong.syrone@gmail.com>
Date: Sun Sep 18 15:46:09 2016 +0800
Drop useless interface impl
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
commit c0a4f3421a
Author: Logan Zhou <xorcererzc@gmail.com>
Date: Sun Sep 18 00:58:02 2016 +0800
Revert "Updated to meet the hint from Wongsyrone."
This reverts commit 84c8053577.
commit 84c8053577
Author: Logan Zhou <xorcererzc@gmail.com>
Date: Sun Sep 18 00:52:21 2016 +0800
Updated to meet the hint from Wongsyrone.
commit 333ccb6d1f
Author: Logan Zhou <xorcererzc@gmail.com>
Date: Sun Sep 18 00:34:52 2016 +0800
Added duplicate button to config form.
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
after creation.
Becuase we put handler.Start() call after timeout check and
lastActivity is initialized in Start(), this will lead to a
incorrect timeout.
Also because we will call handler.Start() right after the
constructor and timeout check, so it makes no difference
where we put the initializtion of lastActivity. We won't do
this again in Start() because DateTime.Now will consumes a
lot of cpu time.
When using http proxy, this will cause distinct latency
if we are trying to resolve localhost.
Currently it's unnecessary to do that because our privoxy
doesn't listern on ipv6 address, so it's ok to hard code
the ipv4 address.
There is a plan to add a cache to record the ipv6 connectivity
so that we needn't to try both ipv4 and ipv6 every time when we
attempt to connect a DnsEndPoint.