Welcome to Just Answer. Leg veins are equipped with little valves that prevent the venous blood from flowing back toward the feet when the heart is in the resting stage between beats. For various reasons these valves can become damaged and don't work as well. The blood "pools" and the fluid part of it leaks out into surrounding tissues causing edema (swelling). This fluid can even leak out of the skin and wet hose or socks, and can result in stasis ulcers which are difficult to clear up.
Walking causes tiny muscles in the legs to help the blood return to the heart. That is why it is important for someone with chronic venous insufficiency to get up and walk as often as possible. There are a number of treatments for venous insufficiency that are detailed below.
Since you think there is a possible infection, you should see your doctor right away for antibiotics.