Fixed hanging networks and sockets in TIME_WAIT
Added flag setting and unsetting. No permissions yet.