update all socket logic, remove old code